diff options
Diffstat (limited to '')
-rw-r--r-- | js/src/tests/test262/built-ins/Object/prototype/__proto__/get-ordinary-obj.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Object/prototype/__proto__/get-ordinary-obj.js b/js/src/tests/test262/built-ins/Object/prototype/__proto__/get-ordinary-obj.js new file mode 100644 index 0000000000..e917d0f307 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/__proto__/get-ordinary-obj.js @@ -0,0 +1,22 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-object.prototype.__proto__ +es6id: B.2.2.1 +description: Normal completion from ordinary object's [[GetPrototypeOf]] +info: | + 1. Let O be ? ToObject(this value). + 2. Return ? O.[[GetPrototypeOf]](). +features: [__proto__] +---*/ + +var get = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').get; +var proto = {}; +var withCustomProto = Object.create(proto); +var withNullProto = Object.create(null); + +assert.sameValue(get.call({}), Object.prototype, 'Ordinary object'); +assert.sameValue(get.call(withCustomProto), proto, 'custom prototype object'); +assert.sameValue(get.call(withNullProto), null, 'null prototype'); + +reportCompare(0, 0); |