15.2.3.7-2-18.js (754B)
1 // Copyright (c) 2012 Ecma International. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 4 /*--- 5 es5id: 15.2.3.7-2-18 6 description: > 7 Object.defineProperties - argument 'Properties' is the global 8 object 9 ---*/ 10 11 var global = this; 12 var obj = {}; 13 var result = false; 14 15 try { 16 Object.defineProperty(this, "prop", { 17 get: function() { 18 result = (this === global); 19 return {}; 20 }, 21 enumerable: true, 22 configurable: true 23 }); 24 25 Object.defineProperties(obj, this); 26 } catch (e) { 27 if (!(e instanceof TypeError)) { 28 throw new Test262Error("Expected TypeError, got " + e); 29 } 30 result = true; 31 } finally { 32 delete this.prop; 33 } 34 35 assert(result, 'result !== true'); 36 37 reportCompare(0, 0);