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 [[Construct]] property
|
2014-07-25 00:41:42 +02:00
|
|
|
es5id: 15.3.5_A3_T2
|
2014-07-22 01:09:02 +02:00
|
|
|
description: >
|
|
|
|
As constructor use new Function("arg1,arg2","var x =1;
|
|
|
|
this.y=arg1+arg2;return \"OK\";")
|
|
|
|
---*/
|
2011-09-07 08:35:18 +02:00
|
|
|
|
2018-02-15 21:49:19 +01:00
|
|
|
var FACTORY = new Function("arg1,arg2", "var x =1; this.y=arg1+arg2;return \"OK\";");
|
|
|
|
var obj = new FACTORY("1", 2);
|
2011-09-07 08:35:18 +02:00
|
|
|
|
2021-08-11 20:53:42 +02:00
|
|
|
assert.sameValue(typeof obj, "object", 'The value of `typeof obj` is expected to be "object"');
|
|
|
|
assert.sameValue(obj.constructor, FACTORY, 'The value of obj.constructor is expected to equal the value of FACTORY');
|
|
|
|
assert.sameValue(obj.y, "12", 'The value of obj.y is expected to be "12"');
|