Debian Codegraph @

js/src/tests/test262/built-ins/Function/S15.3.5_A2_T1.js

raw
1 // Copyright 2009 the Sputnik authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 info: Every function instance has a [[Call]] property
6 es5id: 15.3.5_A2_T1
7 description: For testing call Function("var x =1; this.y=2;return \"OK\";")()
8 ---*/
9 assert.sameValue(
10 Function("var x =1; this.y=2;return \"OK\";")(),
11 "OK",
12 'Function("var x =1; this.y=2;return "OK";")() must return "OK"'
13 );
14
15 assert.sameValue(typeof x, "undefined", 'The value of `typeof x` is expected to be "undefined"');
16 assert.sameValue(y, 2, 'The value of y is expected to be 2');
17
18 reportCompare(0, 0);