Merge pull request #246 from anba/issue-35/builtins-Function

Fix strict mode errors in built-ins/Function
This commit is contained in:
Brian Terlson 2015-04-30 09:36:24 -07:00
commit ca88087731
54 changed files with 96 additions and 75 deletions

View File

@ -7,8 +7,8 @@ es5id: 15.3.5_A3_T1
description: As constructor use Function("var x =1; this.y=2;return \"OK\";") description: As constructor use Function("var x =1; this.y=2;return \"OK\";")
---*/ ---*/
FACTORY = Function("var x =1; this.y=2;return \"OK\";"); var FACTORY = Function("var x =1; this.y=2;return \"OK\";");
obj = new FACTORY; var obj = new FACTORY;
//CHECK#1 //CHECK#1
if (typeof obj !== "object") { if (typeof obj !== "object") {

View File

@ -9,8 +9,8 @@ description: >
this.y=arg1+arg2;return \"OK\";") this.y=arg1+arg2;return \"OK\";")
---*/ ---*/
FACTORY = new Function("arg1,arg2","var x =1; this.y=arg1+arg2;return \"OK\";"); var FACTORY = new Function("arg1,arg2","var x =1; this.y=arg1+arg2;return \"OK\";");
obj = new FACTORY("1",2); var obj = new FACTORY("1",2);
//CHECK#1 //CHECK#1
if (typeof obj !== "object") { if (typeof obj !== "object") {

View File

@ -10,7 +10,7 @@ description: Checking length property of Function("arg1,arg2,arg3", null)
includes: [$FAIL.js] includes: [$FAIL.js]
---*/ ---*/
f = new Function("arg1,arg2,arg3", null); var f = new Function("arg1,arg2,arg3", null);
//CHECK#1 //CHECK#1
if (!(f.hasOwnProperty('length'))) { if (!(f.hasOwnProperty('length'))) {

View File

@ -12,7 +12,7 @@ description: >
includes: [$FAIL.js] includes: [$FAIL.js]
---*/ ---*/
f = Function("arg1,arg2,arg3","arg4,arg5", null); var f = Function("arg1,arg2,arg3","arg4,arg5", null);
//CHECK#1 //CHECK#1
if (!(f.hasOwnProperty('length'))) { if (!(f.hasOwnProperty('length'))) {

View File

@ -12,7 +12,7 @@ description: >
includes: [$FAIL.js] includes: [$FAIL.js]
---*/ ---*/
f = new Function("arg1,arg2,arg3","arg1,arg2","arg3", null); var f = new Function("arg1,arg2,arg3","arg1,arg2","arg3", null);
//CHECK#1 //CHECK#1
if (!(f.hasOwnProperty('length'))) { if (!(f.hasOwnProperty('length'))) {

View File

@ -10,7 +10,7 @@ description: >
includes: [$FAIL.js] includes: [$FAIL.js]
---*/ ---*/
f = new Function("arg1,arg2,arg3", null); var f = new Function("arg1,arg2,arg3", null);
//CHECK#1 //CHECK#1
if (!(f.hasOwnProperty('length'))) { if (!(f.hasOwnProperty('length'))) {

View File

@ -10,7 +10,7 @@ description: >
includes: [$FAIL.js] includes: [$FAIL.js]
---*/ ---*/
f = Function("arg1,arg2,arg3","arg4,arg5", null); var f = Function("arg1,arg2,arg3","arg4,arg5", null);
//CHECK#1 //CHECK#1
if (!(f.hasOwnProperty('length'))) { if (!(f.hasOwnProperty('length'))) {

View File

@ -10,7 +10,7 @@ description: >
includes: [$FAIL.js] includes: [$FAIL.js]
---*/ ---*/
f = new Function("arg1,arg2,arg3","arg1,arg2","arg3", null); var f = new Function("arg1,arg2,arg3","arg1,arg2","arg3", null);
//CHECK#1 //CHECK#1
if (!(f.hasOwnProperty('length'))) { if (!(f.hasOwnProperty('length'))) {

View File

@ -7,6 +7,7 @@ es5id: 15.3.5.1_A3_T1
description: > description: >
Checking if varying the length property of Checking if varying the length property of
Function("arg1,arg2,arg3","arg4,arg5", null) fails Function("arg1,arg2,arg3","arg4,arg5", null) fails
flags: [noStrict]
includes: [$FAIL.js] includes: [$FAIL.js]
---*/ ---*/

View File

@ -7,6 +7,7 @@ es5id: 15.3.5.1_A3_T2
description: > description: >
Checking if varying the length property of Checking if varying the length property of
Function("arg1,arg2,arg3", null) fails Function("arg1,arg2,arg3", null) fails
flags: [noStrict]
includes: [$FAIL.js] includes: [$FAIL.js]
---*/ ---*/

View File

@ -7,6 +7,7 @@ es5id: 15.3.5.1_A3_T3
description: > description: >
Checking if varying the length property of Checking if varying the length property of
Function("arg1,arg2,arg3","arg1,arg2","arg3", null) fails Function("arg1,arg2,arg3","arg1,arg2","arg3", null) fails
flags: [noStrict]
includes: [$FAIL.js] includes: [$FAIL.js]
---*/ ---*/

View File

@ -10,14 +10,14 @@ description: >
includes: [$FAIL.js] includes: [$FAIL.js]
---*/ ---*/
f = new Function("arg1,arg2,arg3", null); var f = new Function("arg1,arg2,arg3", null);
//CHECK#1 //CHECK#1
if (!(f.hasOwnProperty('length'))) { if (!(f.hasOwnProperty('length'))) {
$FAIL('#1: the function has length property.'); $FAIL('#1: the function has length property.');
} }
for(key in f) for(var key in f)
if(key=="length") if(key=="length")
var lengthenumed=true; var lengthenumed=true;

View File

@ -10,14 +10,14 @@ description: >
includes: [$FAIL.js] includes: [$FAIL.js]
---*/ ---*/
f = Function("arg1,arg2,arg3","arg5,arg4", null); var f = Function("arg1,arg2,arg3","arg5,arg4", null);
//CHECK#1 //CHECK#1
if (!(f.hasOwnProperty('length'))) { if (!(f.hasOwnProperty('length'))) {
$FAIL('#1: the function has length property.'); $FAIL('#1: the function has length property.');
} }
for(key in f) for(var key in f)
if(key=="length") if(key=="length")
var lengthenumed=true; var lengthenumed=true;

View File

@ -10,14 +10,14 @@ description: >
includes: [$FAIL.js] includes: [$FAIL.js]
---*/ ---*/
f = new Function("arg1,arg2,arg3","arg1,arg2","arg3", null); var f = new Function("arg1,arg2,arg3","arg1,arg2","arg3", null);
//CHECK#1 //CHECK#1
if (!(f.hasOwnProperty('length'))) { if (!(f.hasOwnProperty('length'))) {
$FAIL('#1: the function has length property.'); $FAIL('#1: the function has length property.');
} }
for(key in f) for(var key in f)
if(key=="length") if(key=="length")
var lengthenumed=true; var lengthenumed=true;

View File

@ -5,6 +5,7 @@
info: The Function.prototype property has the attribute ReadOnly info: The Function.prototype property has the attribute ReadOnly
es5id: 15.3.3.1_A1 es5id: 15.3.3.1_A1
description: Checking if varying the Function.prototype property fails description: Checking if varying the Function.prototype property fails
flags: [noStrict]
---*/ ---*/
var obj = Function.prototype; var obj = Function.prototype;

View File

@ -15,7 +15,7 @@ if (Function.propertyIsEnumerable('prototype')) {
// CHECK#2 // CHECK#2
var count=0; var count=0;
for (p in Function){ for (var p in Function){
if (p==="prototype") count++; if (p==="prototype") count++;
} }

View File

@ -5,6 +5,7 @@
info: The Function.prototype property has the attribute DontDelete info: The Function.prototype property has the attribute DontDelete
es5id: 15.3.3.1_A3 es5id: 15.3.3.1_A3
description: Checking if deleting the Function.prototype property fails description: Checking if deleting the Function.prototype property fails
flags: [noStrict]
---*/ ---*/
delete Function.prototype; delete Function.prototype;

View File

@ -4,7 +4,7 @@
/*--- /*---
info: > info: >
The Function prototype object is itself a Function object without The Function prototype object is itself a Function object without
[[create]] property [[Construct]] property
es5id: 15.3.4_A5 es5id: 15.3.4_A5
description: Checking if creating "new Function.prototype object" fails description: Checking if creating "new Function.prototype object" fails
includes: includes:
@ -15,8 +15,8 @@ includes:
//CHECK# //CHECK#
try { try {
var obj = new Function.prototype; var obj = new Function.prototype;
$FAIL('#1: The Function prototype object is itself a Function object without [[create]] property: '+e); $FAIL('#1: The Function prototype object is itself a Function object without [[Construct]] property: '+e);
} catch (e) { } catch (e) {
$PRINT("#1.1: The Function prototype object is itself a Function object without [[create]] property "+e); $PRINT("#1.1: The Function prototype object is itself a Function object without [[Construct]] property "+e);
} }

View File

@ -7,6 +7,7 @@ es5id: 15.3.5.2_A1_T1
description: > description: >
Checking if deleting the prototype property of Function("", null) Checking if deleting the prototype property of Function("", null)
fails fails
flags: [noStrict]
includes: [$FAIL.js] includes: [$FAIL.js]
---*/ ---*/

View File

@ -7,6 +7,7 @@ es5id: 15.3.5.2_A1_T2
description: > description: >
Checking if deleting the prototype property of Function(void 0, Checking if deleting the prototype property of Function(void 0,
"") fails "") fails
flags: [noStrict]
includes: [$FAIL.js] includes: [$FAIL.js]
---*/ ---*/

View File

@ -7,6 +7,7 @@ es5id: 15.3.4.3_A10
description: > description: >
Checking if varying the Function.prototype.apply.length property Checking if varying the Function.prototype.apply.length property
fails fails
flags: [noStrict]
includes: [$FAIL.js] includes: [$FAIL.js]
---*/ ---*/

View File

@ -7,6 +7,7 @@ info: >
object as the this value object as the this value
es5id: 15.3.4.3_A3_T10 es5id: 15.3.4.3_A3_T10
description: Checking by using eval, no any arguments at apply function description: Checking by using eval, no any arguments at apply function
flags: [noStrict]
---*/ ---*/
eval(" (function(){this.feat=1}).apply()"); eval(" (function(){this.feat=1}).apply()");

View File

@ -9,6 +9,7 @@ es5id: 15.3.4.3_A3_T6
description: > description: >
Argument at apply function is null and it called inside function Argument at apply function is null and it called inside function
declaration declaration
flags: [noStrict]
---*/ ---*/
function FACTORY(){ function FACTORY(){

View File

@ -9,6 +9,7 @@ es5id: 15.3.4.3_A3_T8
description: > description: >
Argument at apply function is undefined and it called inside Argument at apply function is undefined and it called inside
function declaration function declaration
flags: [noStrict]
---*/ ---*/
(function FACTORY(){ (function FACTORY(){

View File

@ -7,6 +7,7 @@ info: >
ToObject(thisArg) as the this value ToObject(thisArg) as the this value
es5id: 15.3.4.3_A5_T3 es5id: 15.3.4.3_A5_T3
description: thisArg is string description: thisArg is string
flags: [noStrict]
---*/ ---*/
var obj="soap"; var obj="soap";

View File

@ -7,6 +7,7 @@ info: >
ToObject(thisArg) as the this value ToObject(thisArg) as the this value
es5id: 15.3.4.3_A5_T4 es5id: 15.3.4.3_A5_T4
description: thisArg is function variable that return this description: thisArg is function variable that return this
flags: [noStrict]
---*/ ---*/
f = function(){this.touched= true; return this;}; f = function(){this.touched= true; return this;};

View File

@ -10,7 +10,7 @@ description: argArray is (object,"1,3,4")
includes: [$FAIL.js] includes: [$FAIL.js]
---*/ ---*/
obj={}; var obj={};
//CHECK#1 //CHECK#1
try { try {

View File

@ -9,11 +9,11 @@ es5id: 15.3.4.3_A7_T3
description: argArray is (empty object, new Array("nine","inch","nails")) description: argArray is (empty object, new Array("nine","inch","nails"))
---*/ ---*/
i=0; var i=0;
p={toString:function(){return "a"+(++i);}}; var p={toString:function(){return "a"+(++i);}};
obj={}; var obj={};
Function(p,"a2,a3","this.shifted=a1;").apply(obj, new Array("nine","inch","nails")); Function(p,"a2,a3","this.shifted=a1;").apply(obj, new Array("nine","inch","nails"));

View File

@ -11,11 +11,11 @@ description: >
("a","b","c")) ("a","b","c"))
---*/ ---*/
i=0; var i=0;
p={toString:function(){return "a"+(++i);}}; var p={toString:function(){return "a"+(++i);}};
obj={}; var obj={};
new Function(p,p,p, "this.shifted=a3;").apply( obj,( function(){return arguments;}) ("a","b","c") ); new Function(p,p,p, "this.shifted=a3;").apply( obj,( function(){return arguments;}) ("a","b","c") );

View File

@ -13,7 +13,7 @@ function FACTORY(){
Function("a1,a2,a3","this.shifted=a1+a2+a3;").apply(null,arguments); Function("a1,a2,a3","this.shifted=a1+a2+a3;").apply(null,arguments);
} }
obj=new FACTORY("",1,2); var obj=new FACTORY("",1,2);
//CHECK#1 //CHECK#1
if (this["shifted"] !== "12") { if (this["shifted"] !== "12") {

View File

@ -13,7 +13,7 @@ function FACTORY(){
Function("a1,a2,a3","this.shifted=a1+a2+a3;").apply(this,arguments); Function("a1,a2,a3","this.shifted=a1+a2+a3;").apply(this,arguments);
} }
obj=new FACTORY("",4,2); var obj=new FACTORY("",4,2);
//CHECK#1 //CHECK#1
if (obj["shifted"] !== "42") { if (obj["shifted"] !== "42") {

View File

@ -17,7 +17,7 @@ function FACTORY(){
return obj; return obj;
} }
obj=new FACTORY("",1,2); var obj=new FACTORY("",1,2);
//CHECK#1 //CHECK#1
if (typeof this["shifted"] !== "undefined") { if (typeof this["shifted"] !== "undefined") {

View File

@ -2,16 +2,16 @@
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
info: Function.prototype.apply can`t be used as [[create]] caller info: Function.prototype.apply can`t be used as [[Construct]] caller
es5id: 15.3.4.3_A8_T1 es5id: 15.3.4.3_A8_T1
description: Checking if creating "new Function.prototype.apply" fails description: Checking if creating "new Function.prototype.apply" fails
---*/ ---*/
try { try {
obj = new Function.prototype.apply; var obj = new Function.prototype.apply;
$ERROR('#1: Function.prototype.apply can\'t be used as [[create]] caller'); $ERROR('#1: Function.prototype.apply can\'t be used as [[Construct]] caller');
} catch (e) { } catch (e) {
if (!(e instanceof TypeError)) { if (!(e instanceof TypeError)) {
$ERROR('#1.1: Function.prototype.apply can\'t be used as [[create]] caller'); $ERROR('#1.1: Function.prototype.apply can\'t be used as [[Construct]] caller');
} }
} }

View File

@ -2,16 +2,16 @@
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
info: Function.prototype.apply can`t be used as [[create]] caller info: Function.prototype.apply can`t be used as [[Construct]] caller
es5id: 15.3.4.3_A8_T2 es5id: 15.3.4.3_A8_T2
description: Checking if creating "new Function.prototype.apply()" fails description: Checking if creating "new Function.prototype.apply()" fails
---*/ ---*/
try { try {
obj = new Function.prototype.apply(); var obj = new Function.prototype.apply();
$ERROR('#1: Function.prototype.apply can\'t be used as [[create]] caller'); $ERROR('#1: Function.prototype.apply can\'t be used as [[Construct]] caller');
} catch (e) { } catch (e) {
if (!(e instanceof TypeError)) { if (!(e instanceof TypeError)) {
$ERROR('#1.1: Function.prototype.apply can\'t be used as [[create]] caller'); $ERROR('#1.1: Function.prototype.apply can\'t be used as [[Construct]] caller');
} }
} }

View File

@ -2,16 +2,16 @@
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
info: Function.prototype.apply can`t be used as [[create]] caller info: Function.prototype.apply can`t be used as [[Construct]] caller
es5id: 15.3.4.3_A8_T3 es5id: 15.3.4.3_A8_T3
description: Checking if creating "new Function.apply" fails description: Checking if creating "new Function.apply" fails
---*/ ---*/
try { try {
obj = new Function.apply; var obj = new Function.apply;
$ERROR('#1: Function.prototype.apply can\'t be used as [[create]] caller'); $ERROR('#1: Function.prototype.apply can\'t be used as [[Construct]] caller');
} catch (e) { } catch (e) {
if (!(e instanceof TypeError)) { if (!(e instanceof TypeError)) {
$ERROR('#1.1: Function.prototype.apply can\'t be used as [[create]] caller'); $ERROR('#1.1: Function.prototype.apply can\'t be used as [[Construct]] caller');
} }
} }

View File

@ -2,16 +2,16 @@
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
info: Function.prototype.apply can`t be used as [[create]] caller info: Function.prototype.apply can`t be used as [[Construct]] caller
es5id: 15.3.4.3_A8_T4 es5id: 15.3.4.3_A8_T4
description: Checking if creating "new (Function("this.p1=1").apply)" fails description: Checking if creating "new (Function("this.p1=1").apply)" fails
---*/ ---*/
try { try {
obj = new (Function("this.p1=1").apply); var obj = new (Function("this.p1=1").apply);
$ERROR('#1: Function.prototype.apply can\'t be used as [[create]] caller'); $ERROR('#1: Function.prototype.apply can\'t be used as [[Construct]] caller');
} catch (e) { } catch (e) {
if (!(e instanceof TypeError)) { if (!(e instanceof TypeError)) {
$ERROR('#1.1: Function.prototype.apply can\'t be used as [[create]] caller'); $ERROR('#1.1: Function.prototype.apply can\'t be used as [[Construct]] caller');
} }
} }

View File

@ -2,17 +2,17 @@
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
info: Function.prototype.apply can`t be used as [[create]] caller info: Function.prototype.apply can`t be used as [[Construct]] caller
es5id: 15.3.4.3_A8_T5 es5id: 15.3.4.3_A8_T5
description: Checking if creating "new Function("this.p1=1").apply" fails description: Checking if creating "new Function("this.p1=1").apply" fails
---*/ ---*/
try { try {
FACTORY = Function("this.p1=1").apply; var FACTORY = Function("this.p1=1").apply;
obj = new FACTORY(); var obj = new FACTORY();
$ERROR('#1: Function.prototype.apply can\'t be used as [[create]] caller'); $ERROR('#1: Function.prototype.apply can\'t be used as [[Construct]] caller');
} catch (e) { } catch (e) {
if (!(e instanceof TypeError)) { if (!(e instanceof TypeError)) {
$ERROR('#1.1: Function.prototype.apply can\'t be used as [[create]] caller'); $ERROR('#1.1: Function.prototype.apply can\'t be used as [[Construct]] caller');
} }
} }

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
info: Function.prototype.apply can`t be used as [[create]] caller info: Function.prototype.apply can`t be used as [[Construct]] caller
es5id: 15.3.4.3_A8_T6 es5id: 15.3.4.3_A8_T6
description: > description: >
Checking if creating "new (Function("function Checking if creating "new (Function("function
@ -11,12 +11,12 @@ description: >
//CHECK#1 //CHECK#1
try { try {
obj = new (Function("function f(){this.p1=1;};return f").apply()); var obj = new (Function("function f(){this.p1=1;};return f").apply());
} catch (e) { } catch (e) {
$ERROR('#1: Function.prototype.apply can\'t be used as [[create]] caller'); $ERROR('#1: Function.prototype.apply can\'t be used as [[Construct]] caller');
} }
//CHECK#2 //CHECK#2
if (obj.p1!== 1) { if (obj.p1!== 1) {
$ERROR('#2: Function.prototype.apply can\'t be used as [[create]] caller'); $ERROR('#2: Function.prototype.apply can\'t be used as [[Construct]] caller');
} }

View File

@ -9,6 +9,7 @@ es5id: 15.3.4.5-15-3
description: > description: >
Function.prototype.bind - The [[Writable]] attribute of length Function.prototype.bind - The [[Writable]] attribute of length
property in F set as false property in F set as false
flags: [noStrict]
includes: [runTestCase.js] includes: [runTestCase.js]
---*/ ---*/

View File

@ -7,6 +7,7 @@ es5id: 15.3.4.4_A10
description: > description: >
Checking if varying the Function.prototype.call.length property Checking if varying the Function.prototype.call.length property
fails fails
flags: [noStrict]
includes: [$FAIL.js] includes: [$FAIL.js]
---*/ ---*/

View File

@ -22,7 +22,7 @@ if (Function.prototype.call.propertyIsEnumerable('length')) {
} }
// CHECK#2 // CHECK#2
for (p in Function.prototype.call){ for (var p in Function.prototype.call){
if (p==="length") if (p==="length")
$ERROR('#2: the Function.prototype.call.length property has the attributes DontEnum'); $ERROR('#2: the Function.prototype.call.length property has the attributes DontEnum');
} }

View File

@ -7,6 +7,7 @@ info: >
object as the this value object as the this value
es5id: 15.3.4.4_A3_T10 es5id: 15.3.4.4_A3_T10
description: Checking by using eval, no any arguments at call function description: Checking by using eval, no any arguments at call function
flags: [noStrict]
---*/ ---*/
eval(" (function(){this.feat=1}).call()"); eval(" (function(){this.feat=1}).call()");

View File

@ -9,6 +9,7 @@ es5id: 15.3.4.4_A3_T6
description: > description: >
Argument at call function is null and it called inside function Argument at call function is null and it called inside function
declaration declaration
flags: [noStrict]
---*/ ---*/
function FACTORY(){ function FACTORY(){

View File

@ -9,6 +9,7 @@ es5id: 15.3.4.4_A3_T8
description: > description: >
Argument at call function is undefined and it called inside Argument at call function is undefined and it called inside
function declaration function declaration
flags: [noStrict]
---*/ ---*/
(function FACTORY(){ (function FACTORY(){

View File

@ -7,6 +7,7 @@ info: >
ToObject(thisArg) as the this value ToObject(thisArg) as the this value
es5id: 15.3.4.4_A5_T3 es5id: 15.3.4.4_A5_T3
description: thisArg is string description: thisArg is string
flags: [noStrict]
---*/ ---*/
var obj="soap"; var obj="soap";

View File

@ -7,6 +7,7 @@ info: >
ToObject(thisArg) as the this value ToObject(thisArg) as the this value
es5id: 15.3.4.4_A5_T4 es5id: 15.3.4.4_A5_T4
description: thisArg is function variable that return this description: thisArg is function variable that return this
flags: [noStrict]
---*/ ---*/
var f = function(){this.touched= true; return this;}; var f = function(){this.touched= true; return this;};

View File

@ -2,16 +2,16 @@
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
info: Function.prototype.call can't be used as [[create]] caller info: Function.prototype.call can't be used as [[Construct]] caller
es5id: 15.3.4.4_A7_T1 es5id: 15.3.4.4_A7_T1
description: Checking if creating "new Function.prototype.call" fails description: Checking if creating "new Function.prototype.call" fails
---*/ ---*/
try { try {
var obj = new Function.prototype.call; var obj = new Function.prototype.call;
$ERROR('#1: Function.prototype.call can\'t be used as [[create]] caller'); $ERROR('#1: Function.prototype.call can\'t be used as [[Construct]] caller');
} catch (e) { } catch (e) {
if (!(e instanceof TypeError)) { if (!(e instanceof TypeError)) {
$ERROR('#1.1: Function.prototype.call can\'t be used as [[create]] caller'); $ERROR('#1.1: Function.prototype.call can\'t be used as [[Construct]] caller');
} }
} }

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
info: Function.prototype.call can't be used as [[create]] caller info: Function.prototype.call can't be used as [[Construct]] caller
es5id: 15.3.4.4_A7_T2 es5id: 15.3.4.4_A7_T2
description: Checking if creating "new Function.prototype.call()" fails description: Checking if creating "new Function.prototype.call()" fails
---*/ ---*/
@ -10,9 +10,9 @@ description: Checking if creating "new Function.prototype.call()" fails
try { try {
var FACTORY = Function.prototype.call; var FACTORY = Function.prototype.call;
var obj = new FACTORY(); var obj = new FACTORY();
$ERROR('#1: Function.prototype.call can\'t be used as [[create]] caller'); $ERROR('#1: Function.prototype.call can\'t be used as [[Construct]] caller');
} catch (e) { } catch (e) {
if (!(e instanceof TypeError)) { if (!(e instanceof TypeError)) {
$ERROR('#1.1: Function.prototype.call can\'t be used as [[create]] caller'); $ERROR('#1.1: Function.prototype.call can\'t be used as [[Construct]] caller');
} }
} }

View File

@ -2,16 +2,16 @@
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
info: Function.prototype.call can't be used as [[create]] caller info: Function.prototype.call can't be used as [[Construct]] caller
es5id: 15.3.4.4_A7_T3 es5id: 15.3.4.4_A7_T3
description: Checking if creating "new Function.call" fails description: Checking if creating "new Function.call" fails
---*/ ---*/
try { try {
var obj = new Function.call; var obj = new Function.call;
$ERROR('#1: Function.prototype.call can\'t be used as [[create]] caller'); $ERROR('#1: Function.prototype.call can\'t be used as [[Construct]] caller');
} catch (e) { } catch (e) {
if (!(e instanceof TypeError)) { if (!(e instanceof TypeError)) {
$ERROR('#1.1: Function.prototype.call can\'t be used as [[create]] caller'); $ERROR('#1.1: Function.prototype.call can\'t be used as [[Construct]] caller');
} }
} }

View File

@ -2,16 +2,16 @@
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
info: Function.prototype.call can't be used as [[create]] caller info: Function.prototype.call can't be used as [[Construct]] caller
es5id: 15.3.4.4_A7_T4 es5id: 15.3.4.4_A7_T4
description: Checking if creating "new (Function("this.p1=1").call)" fails description: Checking if creating "new (Function("this.p1=1").call)" fails
---*/ ---*/
try { try {
var obj = new (Function("this.p1=1").call); var obj = new (Function("this.p1=1").call);
$ERROR('#1: Function.prototype.call can\'t be used as [[create]] caller'); $ERROR('#1: Function.prototype.call can\'t be used as [[Construct]] caller');
} catch (e) { } catch (e) {
if (!(e instanceof TypeError)) { if (!(e instanceof TypeError)) {
$ERROR('#1.1: Function.prototype.call can\'t be used as [[create]] caller'); $ERROR('#1.1: Function.prototype.call can\'t be used as [[Construct]] caller');
} }
} }

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
info: Function.prototype.call can't be used as [[create]] caller info: Function.prototype.call can't be used as [[Construct]] caller
es5id: 15.3.4.4_A7_T5 es5id: 15.3.4.4_A7_T5
description: Checking if creating "new Function("this.p1=1").call" fails description: Checking if creating "new Function("this.p1=1").call" fails
---*/ ---*/
@ -10,9 +10,9 @@ description: Checking if creating "new Function("this.p1=1").call" fails
try { try {
var FACTORY = Function("this.p1=1").call; var FACTORY = Function("this.p1=1").call;
var obj = new FACTORY(); var obj = new FACTORY();
$ERROR('#1: Function.prototype.call can\'t be used as [[create]] caller'); $ERROR('#1: Function.prototype.call can\'t be used as [[Construct]] caller');
} catch (e) { } catch (e) {
if (!(e instanceof TypeError)) { if (!(e instanceof TypeError)) {
$ERROR('#1.1: Function.prototype.call can\'t be used as [[create]] caller'); $ERROR('#1.1: Function.prototype.call can\'t be used as [[Construct]] caller');
} }
} }

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
info: Function.prototype.call can't be used as [[create]] caller info: Function.prototype.call can't be used as [[Construct]] caller
es5id: 15.3.4.4_A7_T6 es5id: 15.3.4.4_A7_T6
description: > description: >
Checking if creating "new (Function("function Checking if creating "new (Function("function
@ -13,10 +13,10 @@ description: >
try { try {
var obj = new (Function("function f(){this.p1=1;};return f").call()); var obj = new (Function("function f(){this.p1=1;};return f").call());
} catch (e) { } catch (e) {
$ERROR('#1: Function.prototype.call can\'t be used as [[create]] caller'); $ERROR('#1: Function.prototype.call can\'t be used as [[Construct]] caller');
} }
//CHECK#2 //CHECK#2
if (obj.p1!== 1) { if (obj.p1!== 1) {
$ERROR('#2: Function.prototype.call can\'t be used as [[create]] caller'); $ERROR('#2: Function.prototype.call can\'t be used as [[Construct]] caller');
} }

View File

@ -7,6 +7,7 @@ es5id: 15.3.4.2_A10
description: > description: >
Checking if varying the Function.prototype.toString.length Checking if varying the Function.prototype.toString.length
property fails property fails
flags: [noStrict]
includes: [$FAIL.js] includes: [$FAIL.js]
---*/ ---*/

View File

@ -22,7 +22,7 @@ if (Function.prototype.toString.propertyIsEnumerable('length')) {
} }
// CHECK#2 // CHECK#2
for (p in Function.prototype.toString){ for (var p in Function.prototype.toString){
if (p==="length") if (p==="length")
$ERROR('#2: the Function.prototype.toString.length property has the attributes DontEnum'); $ERROR('#2: the Function.prototype.toString.length property has the attributes DontEnum');
} }