2011-09-07 08:35:18 +02:00
|
|
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
|
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
|
|
|
2014-07-22 01:09:02 +02:00
|
|
|
/*---
|
|
|
|
info: Every function instance has a [[Call]] property
|
2014-07-25 00:41:42 +02:00
|
|
|
es5id: 15.3.5_A2_T1
|
2014-07-22 01:09:02 +02:00
|
|
|
description: For testing call Function("var x =1; this.y=2;return \"OK\";")()
|
|
|
|
---*/
|
2021-08-11 20:53:42 +02:00
|
|
|
assert.sameValue(
|
|
|
|
Function("var x =1; this.y=2;return \"OK\";")(),
|
|
|
|
"OK",
|
|
|
|
'Function("var x =1; this.y=2;return "OK";")() must return "OK"'
|
|
|
|
);
|
2011-09-07 08:35:18 +02:00
|
|
|
|
2021-08-11 20:53:42 +02:00
|
|
|
assert.sameValue(typeof x, "undefined", 'The value of `typeof x` is expected to be "undefined"');
|
|
|
|
assert.sameValue(y, 2, 'The value of y is expected to be 2');
|