tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

fn-name-accessor-set.js (1156B)


      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 es6id: 14.3.9
      6 description: Assignment of function `name` attribute ("set" accessor)
      7 info: |
      8    MethodDefinition :
      9        set PropertyName ( PropertySetParameterList ) { FunctionBody }
     10 
     11    [...]
     12    7. Perform SetFunctionName(closure, propKey, "set").
     13 includes: [propertyHelper.js]
     14 features: [Symbol]
     15 ---*/
     16 
     17 var namedSym = Symbol('test262');
     18 var anonSym = Symbol();
     19 var o, setter;
     20 
     21 o = {
     22  set id(_) {},
     23  set [anonSym](_) {},
     24  set [namedSym](_) {}
     25 };
     26 
     27 setter = Object.getOwnPropertyDescriptor(o, 'id').set;
     28 verifyProperty(setter, 'name', {
     29  value: 'set id',
     30  writable: false,
     31  enumerable: false,
     32  configurable: true,
     33 });
     34 
     35 setter = Object.getOwnPropertyDescriptor(o, anonSym).set;
     36 verifyProperty(setter, 'name', {
     37  value: 'set ',
     38  writable: false,
     39  enumerable: false,
     40  configurable: true,
     41 });
     42 
     43 setter = Object.getOwnPropertyDescriptor(o, namedSym).set;
     44 verifyProperty(setter, 'name', {
     45  value: 'set [test262]',
     46  writable: false,
     47  enumerable: false,
     48  configurable: true,
     49 });
     50 
     51 reportCompare(0, 0);