tor-browser

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

fn-name-accessor-get.js (1120B)


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