| 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-6-a-111 |
| 6 |
description: Object.defineProperties - each properties are in list order |
| 7 |
---*/ |
| 8 |
|
| 9 |
var obj = {}; |
| 10 |
|
| 11 |
function get_func() { |
| 12 |
return 20; |
| 13 |
} |
| 14 |
|
| 15 |
function set_func() {} |
| 16 |
|
| 17 |
var properties = { |
| 18 |
a: { |
| 19 |
value: 100, |
| 20 |
enumerable: true, |
| 21 |
writable: true, |
| 22 |
configurable: true |
| 23 |
}, |
| 24 |
b: { |
| 25 |
get: get_func, |
| 26 |
set: set_func, |
| 27 |
enumerable: true, |
| 28 |
configurable: true |
| 29 |
}, |
| 30 |
c: { |
| 31 |
value: 200, |
| 32 |
enumerable: true, |
| 33 |
writable: true, |
| 34 |
configurable: true |
| 35 |
} |
| 36 |
}; |
| 37 |
|
| 38 |
Object.defineProperties(obj, properties); |
| 39 |
|
| 40 |
assert.sameValue(obj["a"], 100, 'obj["a"]'); |
| 41 |
assert.sameValue(obj["b"], 20, 'obj["b"]'); |
| 42 |
assert.sameValue(obj["c"], 200, 'obj["c"]'); |