Bug 1892041 - Part 2: Update test262. r=spidermonkey-reviewers,dminor
[gecko.git] / js / src / tests / test262 / built-ins / Object / create / 15.2.3.5-4-291.js
blobb92ba9d2c7375bd25238e30f785c3531fb7b31df
1 // Copyright (c) 2012 Ecma International.  All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
4 /*---
5 es5id: 15.2.3.5-4-291
6 description: >
7     Object.create - one property in 'Properties' is the global object
8     that uses Object's [[Get]] method to access the 'set' property
9     (8.10.5 step 8.a)
10 ---*/
12 var data = "data";
14 this.set = function(value) {
15   data = value;
18 var newObj = Object.create({}, {
19   prop: this
20 });
22 var hasProperty = newObj.hasOwnProperty("prop");
24 newObj.prop = "overrideData";
26 assert(hasProperty, 'hasProperty !== true');
27 assert.sameValue(data, "overrideData", 'data');
29 reportCompare(0, 0);