tor-browser

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

spread-obj-override-immutable.js (1228B)


      1 // This file was procedurally generated from the following sources:
      2 // - src/spread/obj-override-immutable.case
      3 // - src/spread/default/call-expr.template
      4 /*---
      5 description: Object Spread overriding immutable properties (CallExpression)
      6 esid: sec-function-calls-runtime-semantics-evaluation
      7 features: [object-spread]
      8 flags: [generated]
      9 includes: [propertyHelper.js]
     10 info: |
     11    CallExpression : MemberExpression Arguments
     12 
     13    [...]
     14    9. Return EvaluateDirectCall(func, thisValue, Arguments, tailCall).
     15 
     16    12.3.4.3 Runtime Semantics: EvaluateDirectCall
     17 
     18    1. Let argList be ArgumentListEvaluation(arguments).
     19    [...]
     20    6. Let result be Call(func, thisValue, argList).
     21    [...]
     22 ---*/
     23 
     24 let o = {b: 2};
     25 Object.defineProperty(o, "a", {value: 1, enumerable: true, writable: false, configurable: true});
     26 
     27 
     28 var callCount = 0;
     29 
     30 (function(obj) {
     31  assert.sameValue(obj.a, 3)
     32  assert.sameValue(obj.b, 2);
     33 
     34  verifyProperty(obj, "a", {
     35    enumerable: true,
     36    writable: true,
     37    configurable: true,
     38    value: 3
     39  });
     40 
     41  verifyProperty(obj, "b", {
     42    enumerable: true,
     43    writable: true,
     44    configurable: true,
     45    value: 2
     46  });
     47  callCount += 1;
     48 }({...o, a: 3}));
     49 
     50 assert.sameValue(callCount, 1);
     51 
     52 reportCompare(0, 0);