Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/call/11.2.3-3_7.js

raw
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: 11.2.3-3_7
6 description: >
7 Call arguments are evaluated before the check is made to see if
8 the object is actually callable (getter called as indexed property)
9 ---*/
10
11 var o = { };
12 Object.defineProperty(o, "bar", {get: function() {this.barGetter = true; return 42;},
13 set: function(x) {this.barSetter = true; }});
14 assert.throws(TypeError, function() {
15 o.foo( o["bar"] );
16 $ERROR("o.foo does not exist!");
17 });
18 assert.sameValue(o.barGetter, true, 'o.barGetter');
19 assert.sameValue(o.barSetter, undefined, 'o.barSetter');