2014-07-22 01:09:02 +02:00
|
|
|
// Copyright (c) 2012 Ecma International. All rights reserved.
|
2015-07-17 17:42:45 +02:00
|
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
2014-07-22 01:09:02 +02:00
|
|
|
|
|
|
|
/*---
|
2018-01-05 18:26:51 +01:00
|
|
|
info: |
|
2014-07-22 01:09:02 +02:00
|
|
|
Step 4 of defineProperty calls the [[DefineOwnProperty]] internal method
|
|
|
|
of O to define the property. For newly defined properties, step 4.a.1 of
|
|
|
|
[[DefineOwnProperty]] creates a data property if handed a generic desc.
|
2014-07-25 00:41:42 +02:00
|
|
|
es5id: 15.2.3.6-4-4
|
2014-07-22 01:09:02 +02:00
|
|
|
description: >
|
|
|
|
Object.defineProperty defines a data property if given a generic
|
|
|
|
desc(8.12.9 step 4.a.i)
|
|
|
|
---*/
|
|
|
|
|
2018-02-15 21:33:45 +01:00
|
|
|
var o = {};
|
2014-07-22 01:09:02 +02:00
|
|
|
|
2018-02-15 21:33:45 +01:00
|
|
|
var desc = {};
|
|
|
|
Object.defineProperty(o, "foo", desc);
|
2015-08-13 17:56:55 +02:00
|
|
|
|
2018-02-15 21:33:45 +01:00
|
|
|
var propDesc = Object.getOwnPropertyDescriptor(o, "foo");
|
|
|
|
|
|
|
|
assert.sameValue(propDesc.value, undefined, 'propDesc.value'); // undefined by default
|
|
|
|
assert.sameValue(propDesc.writable, false, 'propDesc.writable'); // false by default
|
|
|
|
assert.sameValue(propDesc.enumerable, false, 'propDesc.enumerable'); // false by default
|
|
|
|
assert.sameValue(propDesc.configurable, false, 'propDesc.configurable'); // false by default
|