Remove "best practice" tests

Sbp_A1_T1 to Sbp_A5_T2, Sbp_12, Sbp_7*: Functions are now valid in blocks, tests syntactically invalid anyway
Sbp_A10_T1 to Sbp_A10_T2: Tests are broken
This commit is contained in:
Brian Terlson 2014-11-19 14:55:32 -08:00
parent b752d2fdde
commit bbeafbd3c6
20 changed files with 0 additions and 387 deletions

View File

@ -1,20 +0,0 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: Function declaration within an "if" statement is not allowed
description: >
Declaring function within an "if" statement that is declared
within the function declaration
negative: SyntaxError
---*/
function(){
if (true) {
function __func(){};
} else {
function __func(){};
}
};

View File

@ -1,18 +0,0 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: FunctionDeclaration within a "do-while" Block is not allowed
description: >
Declaring a function within a "do-while" loop that is within a
function declaration itself
negative: SyntaxError
---*/
function(){
do{
function __func(){};
}while(0);
};

View File

@ -1,18 +0,0 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: FunctionDeclaration within a "while" Statement is not allowed
description: >
Checking if declaring a function within a "while" Statement that
is in a function body leads to an exception
negative: SyntaxError
---*/
function(){
while(0){
function __func(){};
};
};

View File

@ -1,18 +0,0 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: FunctionDeclaration within a "for-in" Statement is not allowed
description: >
Declaring function within a "for-in" Statement that is within
function declaration
negative: SyntaxError
---*/
function(){
for(x in this){
function __func(){};
};
};

View File

@ -1,11 +0,0 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: "EscapeSequence :: HexEscapeSequence :: x HexDigit HexDigit"
description: "HexEscapeSequence :: x0G is incorrect"
negative: SyntaxError
---*/
//CHECK#
"\x0G"

View File

@ -1,11 +0,0 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: "HexEscapeSequence :: x HexDigit is incorrect"
description: "HexDigit :: 1"
negative: SyntaxError
---*/
//CHECK#1
"\x1"

View File

@ -1,11 +0,0 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: "HexEscapeSequence :: x HexDigit is incorrect"
description: "HexDigit :: A"
negative: SyntaxError
---*/
//CHECK#1
"\xA"

View File

@ -1,12 +0,0 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: Check Do-While Statement for automatic semicolon insertion
description: Execute do { \n ; \n }while(false) true
---*/
//CHECK#1
do {
;
} while (false) true

View File

@ -1,11 +0,0 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: Check Do-While Statement for automatic semicolon insertion
description: Execute do ; while \n (false) true
---*/
//CHECK#1
do ; while
(false) true

View File

@ -1,45 +0,0 @@
// Copyright 2011 Google Inc. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: >
Built-in functions should not have a non-deletable, non-poisoned
"caller" property.
bestPractice: "http://wiki.ecmascript.org/doku.php?id=conventions:make_non-standard_properties_configurable"
---*/
(function() {
var map = Array.prototype.map;
if (!map) { return; }
try {
delete map.caller;
} catch (err1) {
// ignore
}
if ('caller' in map) {
try {
Object.defineProperty(map, 'caller', {
writable: false,
configurable: false
});
} catch (err2) {
// ignore
}
}
function foo(m) { return m.caller; }
function testfn(a, f) { return a.map(f)[0]; }
var a = [map];
var caller;
try {
caller = testfn(a, foo);
} catch (err3) {
if (err3 instanceof TypeError) { return; }
$ERROR('#1: Built-in "caller" failed with: ' + err3);
}
if (null === caller || void 0 === caller) { return; }
if (testfn === caller) {
$ERROR('#2: Built-in revealed caller');
}
$ERROR('#3: Unexpected "caller": ' + caller);
})();

View File

@ -1,45 +0,0 @@
// Copyright 2011 Google Inc. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: >
Built-in functions should not have a non-deletable, non-poisoned
"arguments" property.
bestPractice: "http://wiki.ecmascript.org/doku.php?id=conventions:make_non-standard_properties_configurable"
---*/
(function() {
var map = Array.prototype.map;
if (!map) { return; }
try {
delete map.arguments;
} catch (err1) {
// ignore
}
if ('arguments' in map) {
try {
Object.defineProperty(map, 'arguments', {
writable: false,
configurable: false
});
} catch (err2) {
// ignore
}
}
function foo(m) { return m.arguments; }
function testfn(a, f) { return a.map(f)[0]; }
var a = [map];
var args;
try {
args = testfn(a, foo);
} catch (err3) {
if (err3 instanceof TypeError) { return; }
$ERROR('#1: Built-in "arguments" failed with: ' + err3);
}
if (null === args || void 0 === args) { return; }
if (testfn === args) {
$ERROR('#2: Built-in revealed arguments');
}
$ERROR('#3: Unexpected "arguments": ' + args);
})();

View File

@ -1,17 +0,0 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: >
The production Block { } in strict code can't contain function
declaration;
description: Trying to declare function at the Block statement
negative: SyntaxError
bestPractice: "http://wiki.ecmascript.org/doku.php?id=conventions:no_non_standard_strict_decls"
flags: [onlyStrict]
---*/
"use strict";
{
function __func(){}
}

View File

@ -1,19 +0,0 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: >
Function declaration within an "if" statement in strict code is not
allowed
description: Declaring function within a strict "if" statement
negative: SyntaxError
bestPractice: "http://wiki.ecmascript.org/doku.php?id=conventions:no_non_standard_strict_decls"
flags: [onlyStrict]
---*/
"use strict";
if (true) {
function __func(){};
} else {
function __func(){};
}

View File

@ -1,23 +0,0 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: >
Function declaration within an "if" statement in strict code is not
allowed;
description: >
Declaring function within an "if" that is declared within the
strict function
negative: SyntaxError
bestPractice: "http://wiki.ecmascript.org/doku.php?id=conventions:no_non_standard_strict_decls"
flags: [onlyStrict]
---*/
"use strict";
(function(){
if (true) {
function __func(){};
} else {
function __func(){};
}
});

View File

@ -1,17 +0,0 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: >
FunctionDeclaration within a "do-while" Block in strict code is not
allowed
description: Declaring function within a "do-while" loop
negative: SyntaxError
bestPractice: "http://wiki.ecmascript.org/doku.php?id=conventions:no_non_standard_strict_decls"
flags: [onlyStrict]
---*/
"use strict";
do {
function __func(){};
} while(0);

View File

@ -1,21 +0,0 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: >
FunctionDeclaration within a "do-while" Block in strict code is not
allowed
description: >
Declaring a function within a "do-while" loop that is within a
strict function
negative: SyntaxError
bestPractice: "http://wiki.ecmascript.org/doku.php?id=conventions:no_non_standard_strict_decls"
flags: [onlyStrict]
---*/
"use strict";
(function(){
do {
function __func(){};
} while(0);
});

View File

@ -1,17 +0,0 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: FunctionDeclaration within a "while" Statement is not allowed
description: >
Checking if declaring a function within a "while" Statement leads
to an exception
negative: SyntaxError
bestPractice: "http://wiki.ecmascript.org/doku.php?id=conventions:no_non_standard_strict_decls"
flags: [onlyStrict]
---*/
"use strict";
while (0) {
function __func(){};
};

View File

@ -1,19 +0,0 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: FunctionDeclaration within a "while" Statement is not allowed
description: >
Checking if declaring a function within a "while" Statement that
is in a function call leads to an exception
negative: SyntaxError
bestPractice: "http://wiki.ecmascript.org/doku.php?id=conventions:no_non_standard_strict_decls"
flags: [onlyStrict]
---*/
"use strict";
(function(){
while (0) {
function __func(){};
};
})();

View File

@ -1,15 +0,0 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: FunctionDeclaration within a "for-in" Statement is not allowed
description: Declaring function within a "for-in" Statement
negative: SyntaxError
bestPractice: "http://wiki.ecmascript.org/doku.php?id=conventions:no_non_standard_strict_decls"
flags: [onlyStrict]
---*/
"use strict";
for (x in this) {
function __func(){};
}

View File

@ -1,19 +0,0 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: FunctionDeclaration within a "for-in" Statement is not allowed
description: >
Declaring function within a "for-in" Statement that is within a
function call
negative: SyntaxError
bestPractice: "http://wiki.ecmascript.org/doku.php?id=conventions:no_non_standard_strict_decls"
flags: [onlyStrict]
---*/
"use strict";
(function(){
for (x in this) {
function __func(){};
}
})();