tor-browser

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

ObjectOverride-sameproperty.js (495B)


      1 // Copyright 2015 Microsoft Corporation. All rights reserved.
      2 // This code is governed by the license found in the LICENSE file.
      3 
      4 /*---
      5 description: >
      6  Object properties are assigned to target in ascending index order,
      7  i.e. a later assignment to the same property overrides an earlier assignment.
      8 es6id:  19.1.2.1
      9 ---*/
     10 
     11 var target = {
     12  a: 1
     13 };
     14 var result = Object.assign(target, {
     15  a: 2
     16 }, {
     17  a: "c"
     18 });
     19 
     20 assert.sameValue(result.a, "c", "The value should be 'c'.");
     21 
     22 reportCompare(0, 0);