name-params.js (565B)
1 // Copyright (C) 2015 the V8 project authors. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 4 /*--- 5 description: > 6 Functions declared as methods honor their declared formal parameters. 7 es6id: 14.3.8 8 ---*/ 9 10 var value1 = {}; 11 var value2 = {}; 12 var value3 = {}; 13 var arg1, arg2, arg3; 14 var obj = { 15 method(a, b, c) { 16 arg1 = a; 17 arg2 = b; 18 arg3 = c; 19 } 20 }; 21 22 obj.method(value1, value2, value3); 23 24 assert.sameValue(arg1, value1); 25 assert.sameValue(arg2, value2); 26 assert.sameValue(arg3, value3); 27 28 reportCompare(0, 0);