| 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)) throw e; |
| 28 |
result = true; |
| 29 |
} finally { |
| 30 |
delete this.prop; |
| 31 |
} |
| 32 |
|
| 33 |
assert(result, 'result !== true'); |