diff options
Diffstat (limited to 'js/src/tests/test262/language/block-scope/syntax/function-declarations')
9 files changed, 108 insertions, 0 deletions
diff --git a/js/src/tests/test262/language/block-scope/syntax/function-declarations/browser.js b/js/src/tests/test262/language/block-scope/syntax/function-declarations/browser.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/js/src/tests/test262/language/block-scope/syntax/function-declarations/browser.js diff --git a/js/src/tests/test262/language/block-scope/syntax/function-declarations/in-statement-position-case-expression-statement-list.js b/js/src/tests/test262/language/block-scope/syntax/function-declarations/in-statement-position-case-expression-statement-list.js new file mode 100644 index 0000000000..0d4a759993 --- /dev/null +++ b/js/src/tests/test262/language/block-scope/syntax/function-declarations/in-statement-position-case-expression-statement-list.js @@ -0,0 +1,12 @@ +// Copyright (C) 2011 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +es6id: 13.1 +description: > + function declarations in statement position in strict mode: + case Expression : StatementList +---*/ +switch (true) { case true: function g() {} } + + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/block-scope/syntax/function-declarations/in-statement-position-default-statement-list.js b/js/src/tests/test262/language/block-scope/syntax/function-declarations/in-statement-position-default-statement-list.js new file mode 100644 index 0000000000..cb656254c0 --- /dev/null +++ b/js/src/tests/test262/language/block-scope/syntax/function-declarations/in-statement-position-default-statement-list.js @@ -0,0 +1,12 @@ +// Copyright (C) 2011 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +es6id: 13.1 +description: > + function declarations in statement position in strict mode: + default : StatementList +---*/ +switch (true) { default: function g() {} } + + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/block-scope/syntax/function-declarations/in-statement-position-do-statement-while-expression.js b/js/src/tests/test262/language/block-scope/syntax/function-declarations/in-statement-position-do-statement-while-expression.js new file mode 100644 index 0000000000..7e21f7ff75 --- /dev/null +++ b/js/src/tests/test262/language/block-scope/syntax/function-declarations/in-statement-position-do-statement-while-expression.js @@ -0,0 +1,16 @@ +// |reftest| error:SyntaxError +// Copyright (C) 2011 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +es6id: 13.1 +description: > + function declarations in statement position: + do Statement while ( Expression ) +negative: + phase: parse + type: SyntaxError +---*/ + +$DONOTEVALUATE(); +do function g() {} while (false) + diff --git a/js/src/tests/test262/language/block-scope/syntax/function-declarations/in-statement-position-for-statement.js b/js/src/tests/test262/language/block-scope/syntax/function-declarations/in-statement-position-for-statement.js new file mode 100644 index 0000000000..f69e43ff18 --- /dev/null +++ b/js/src/tests/test262/language/block-scope/syntax/function-declarations/in-statement-position-for-statement.js @@ -0,0 +1,16 @@ +// |reftest| error:SyntaxError +// Copyright (C) 2011 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +es6id: 13.1 +description: > + function declarations in statement position: + for ( ;;) Statement +negative: + phase: parse + type: SyntaxError +---*/ + +$DONOTEVALUATE(); +for (;false;) function g() {} + diff --git a/js/src/tests/test262/language/block-scope/syntax/function-declarations/in-statement-position-if-expression-statement-else-statement-strict.js b/js/src/tests/test262/language/block-scope/syntax/function-declarations/in-statement-position-if-expression-statement-else-statement-strict.js new file mode 100644 index 0000000000..548fffc8fb --- /dev/null +++ b/js/src/tests/test262/language/block-scope/syntax/function-declarations/in-statement-position-if-expression-statement-else-statement-strict.js @@ -0,0 +1,18 @@ +// |reftest| error:SyntaxError +'use strict'; +// Copyright (C) 2011 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +es6id: 13.1 +description: > + function declarations in statement position in strict mode: + if ( Expression ) Statement else Statement +negative: + phase: parse + type: SyntaxError +flags: [onlyStrict] +---*/ + +$DONOTEVALUATE(); +if (true) {} else function g() {} + diff --git a/js/src/tests/test262/language/block-scope/syntax/function-declarations/in-statement-position-if-expression-statement-strict.js b/js/src/tests/test262/language/block-scope/syntax/function-declarations/in-statement-position-if-expression-statement-strict.js new file mode 100644 index 0000000000..63d057e96d --- /dev/null +++ b/js/src/tests/test262/language/block-scope/syntax/function-declarations/in-statement-position-if-expression-statement-strict.js @@ -0,0 +1,18 @@ +// |reftest| error:SyntaxError +'use strict'; +// Copyright (C) 2011 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +es6id: 13.1 +description: > + function declarations in statement position in strict mode: + if ( Expression ) Statement +negative: + phase: parse + type: SyntaxError +flags: [onlyStrict] +---*/ + +$DONOTEVALUATE(); +if (true) function g() {} + diff --git a/js/src/tests/test262/language/block-scope/syntax/function-declarations/in-statement-position-while-expression-statement.js b/js/src/tests/test262/language/block-scope/syntax/function-declarations/in-statement-position-while-expression-statement.js new file mode 100644 index 0000000000..69063f05f3 --- /dev/null +++ b/js/src/tests/test262/language/block-scope/syntax/function-declarations/in-statement-position-while-expression-statement.js @@ -0,0 +1,16 @@ +// |reftest| error:SyntaxError +// Copyright (C) 2011 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +es6id: 13.1 +description: > + function declarations in statement position: + while ( Expression ) Statement +negative: + phase: parse + type: SyntaxError +---*/ + +$DONOTEVALUATE(); +while (false) function g() {} + diff --git a/js/src/tests/test262/language/block-scope/syntax/function-declarations/shell.js b/js/src/tests/test262/language/block-scope/syntax/function-declarations/shell.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/js/src/tests/test262/language/block-scope/syntax/function-declarations/shell.js |