object-hasOwnProperty-binding-uninit.js (1137B)
1 // |reftest| module 2 // Copyright (C) 2017 André Bargull. All rights reserved. 3 // This code is governed by the BSD license found in the LICENSE file. 4 5 /*--- 6 esid: sec-object.prototype.hasownproperty 7 description: > 8 Test Object.prototype.hasOwnProperty() with uninitialized binding. 9 info: | 10 19.1.3.2 Object.prototype.hasOwnProperty ( V ) 11 ... 12 3. Return ? HasOwnProperty(O, P). 13 14 7.3.11 HasOwnProperty ( O, P ) 15 ... 16 3. Let desc be ? O.[[GetOwnProperty]](P). 17 ... 18 19 9.4.6.4 [[GetOwnProperty]] (P) 20 ... 21 4. Let value be ? O.[[Get]](P, O). 22 ... 23 24 9.4.6.7 [[Get]] (P, Receiver) 25 ... 26 12. Let targetEnvRec be targetEnv's EnvironmentRecord. 27 13. Return ? targetEnvRec.GetBindingValue(binding.[[BindingName]], true). 28 29 8.1.1.1.6 GetBindingValue ( N, S ) 30 ... 31 If the binding for N in envRec is an uninitialized binding, throw a ReferenceError exception. 32 ... 33 34 flags: [module] 35 ---*/ 36 37 import* as self from "./object-hasOwnProperty-binding-uninit.js"; 38 39 assert.throws(ReferenceError, function() { 40 Object.prototype.hasOwnProperty.call(self, "default"); 41 }); 42 43 export default 0; 44 45 reportCompare(0, 0);