diff options
Diffstat (limited to 'js/src/tests/test262/language/future-reserved-words')
57 files changed, 1030 insertions, 0 deletions
diff --git a/js/src/tests/test262/language/future-reserved-words/_implements.js b/js/src/tests/test262/language/future-reserved-words/_implements.js new file mode 100644 index 0000000000..914b692771 --- /dev/null +++ b/js/src/tests/test262/language/future-reserved-words/_implements.js @@ -0,0 +1,14 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 7.6.1.2-16-s +description: > + SyntaxError isn't thrown when '_implements' occurs +---*/ + +var _implements = 1; + +assert.sameValue(_implements, 1, '_implements'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/future-reserved-words/abstract.js b/js/src/tests/test262/language/future-reserved-words/abstract.js new file mode 100644 index 0000000000..3a7809ae83 --- /dev/null +++ b/js/src/tests/test262/language/future-reserved-words/abstract.js @@ -0,0 +1,14 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-future-reserved-words +es5id: 7.6.1.2_A1.1 +description: Checking if execution of "abstract=1" succeeds +info: | + `abstract` was removed from the list of future reserved words in ECMAScript 5. +---*/ + +var abstract = 1; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/future-reserved-words/boolean.js b/js/src/tests/test262/language/future-reserved-words/boolean.js new file mode 100644 index 0000000000..d151b2bc69 --- /dev/null +++ b/js/src/tests/test262/language/future-reserved-words/boolean.js @@ -0,0 +1,14 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-future-reserved-words +es5id: 7.6.1.2_A1.2 +description: Checking if execution of "boolean=1" succeeds +info: | + `boolean` was removed from the list of future reserved words in ECMAScript 5. +---*/ + +var boolean = 1; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/future-reserved-words/browser.js b/js/src/tests/test262/language/future-reserved-words/browser.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/js/src/tests/test262/language/future-reserved-words/browser.js diff --git a/js/src/tests/test262/language/future-reserved-words/byte.js b/js/src/tests/test262/language/future-reserved-words/byte.js new file mode 100644 index 0000000000..0b0862c099 --- /dev/null +++ b/js/src/tests/test262/language/future-reserved-words/byte.js @@ -0,0 +1,14 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-future-reserved-words +es5id: 7.6.1.2_A1.3 +description: Checking if execution of "byte=1" succeeds +info: | + `byte` was removed from the list of future reserved words in ECMAScript 5. +---*/ + +var byte = 1; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/future-reserved-words/char.js b/js/src/tests/test262/language/future-reserved-words/char.js new file mode 100644 index 0000000000..dd2fbcf2ae --- /dev/null +++ b/js/src/tests/test262/language/future-reserved-words/char.js @@ -0,0 +1,14 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-future-reserved-words +es5id: 7.6.1.2_A1.4 +description: Checking if execution of "char=1" succeeds +info: | + `char` was removed from the list of future reserved words in ECMAScript 5. +---*/ + +var char = 1; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/future-reserved-words/class.js b/js/src/tests/test262/language/future-reserved-words/class.js new file mode 100644 index 0000000000..4eec35fef3 --- /dev/null +++ b/js/src/tests/test262/language/future-reserved-words/class.js @@ -0,0 +1,21 @@ +// |reftest| error:SyntaxError +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-identifiers-static-semantics-early-errors +es5id: 7.6.1.2_A1.5 +description: Checking if execution of "class=1" fails +info: | + Identifier : IdentifierName but not ReservedWord + + It is a Syntax Error if StringValue of IdentifierName is the same String + value as the StringValue of any ReservedWord except for yield and await. +negative: + phase: parse + type: SyntaxError +---*/ + +$DONOTEVALUATE(); + +var class = 1; diff --git a/js/src/tests/test262/language/future-reserved-words/const.js b/js/src/tests/test262/language/future-reserved-words/const.js new file mode 100644 index 0000000000..96a175abdf --- /dev/null +++ b/js/src/tests/test262/language/future-reserved-words/const.js @@ -0,0 +1,21 @@ +// |reftest| error:SyntaxError +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-identifiers-static-semantics-early-errors +es5id: 7.6.1.2_A1.6 +description: Checking if execution of "const=1" fails +info: | + Identifier : IdentifierName but not ReservedWord + + It is a Syntax Error if StringValue of IdentifierName is the same String + value as the StringValue of any ReservedWord except for yield and await. +negative: + phase: parse + type: SyntaxError +---*/ + +$DONOTEVALUATE(); + +var const = 1; diff --git a/js/src/tests/test262/language/future-reserved-words/debugger.js b/js/src/tests/test262/language/future-reserved-words/debugger.js new file mode 100644 index 0000000000..c9f72eca9a --- /dev/null +++ b/js/src/tests/test262/language/future-reserved-words/debugger.js @@ -0,0 +1,21 @@ +// |reftest| error:SyntaxError +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-identifiers-static-semantics-early-errors +es5id: 7.6.1.2_A1.7 +description: Checking if execution of "debugger=1" fails +info: | + Identifier : IdentifierName but not ReservedWord + + It is a Syntax Error if StringValue of IdentifierName is the same String + value as the StringValue of any ReservedWord except for yield and await. +negative: + phase: parse + type: SyntaxError +---*/ + +$DONOTEVALUATE(); + +var debugger = 1; diff --git a/js/src/tests/test262/language/future-reserved-words/double.js b/js/src/tests/test262/language/future-reserved-words/double.js new file mode 100644 index 0000000000..dc1e3502d1 --- /dev/null +++ b/js/src/tests/test262/language/future-reserved-words/double.js @@ -0,0 +1,14 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-future-reserved-words +es5id: 7.6.1.2_A1.8 +description: Checking if execution of "double=1" succeeds +info: | + `double` was removed from the list of future reserved words in ECMAScript 5. +---*/ + +var double = 1; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/future-reserved-words/enum.js b/js/src/tests/test262/language/future-reserved-words/enum.js new file mode 100644 index 0000000000..fff79dcc82 --- /dev/null +++ b/js/src/tests/test262/language/future-reserved-words/enum.js @@ -0,0 +1,21 @@ +// |reftest| error:SyntaxError +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-identifiers-static-semantics-early-errors +es5id: 7.6.1.2_A1.9 +description: Checking if execution of "enum=1" fails +info: | + Identifier : IdentifierName but not ReservedWord + + It is a Syntax Error if StringValue of IdentifierName is the same String + value as the StringValue of any ReservedWord except for yield and await. +negative: + phase: parse + type: SyntaxError +---*/ + +$DONOTEVALUATE(); + +var enum = 1; diff --git a/js/src/tests/test262/language/future-reserved-words/export.js b/js/src/tests/test262/language/future-reserved-words/export.js new file mode 100644 index 0000000000..0692f5a5b5 --- /dev/null +++ b/js/src/tests/test262/language/future-reserved-words/export.js @@ -0,0 +1,21 @@ +// |reftest| error:SyntaxError +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-identifiers-static-semantics-early-errors +es5id: 7.6.1.2_A1.10 +description: Checking if execution of "export=1" fails +info: | + Identifier : IdentifierName but not ReservedWord + + It is a Syntax Error if StringValue of IdentifierName is the same String + value as the StringValue of any ReservedWord except for yield and await. +negative: + phase: parse + type: SyntaxError +---*/ + +$DONOTEVALUATE(); + +var export = 1; diff --git a/js/src/tests/test262/language/future-reserved-words/extends.js b/js/src/tests/test262/language/future-reserved-words/extends.js new file mode 100644 index 0000000000..1314652fb5 --- /dev/null +++ b/js/src/tests/test262/language/future-reserved-words/extends.js @@ -0,0 +1,21 @@ +// |reftest| error:SyntaxError +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-identifiers-static-semantics-early-errors +es5id: 7.6.1.2_A1.11 +description: Checking if execution of "extends=1" fails +info: | + Identifier : IdentifierName but not ReservedWord + + It is a Syntax Error if StringValue of IdentifierName is the same String + value as the StringValue of any ReservedWord except for yield and await. +negative: + phase: parse + type: SyntaxError +---*/ + +$DONOTEVALUATE(); + +var extends = 1; diff --git a/js/src/tests/test262/language/future-reserved-words/final.js b/js/src/tests/test262/language/future-reserved-words/final.js new file mode 100644 index 0000000000..4070fba6ca --- /dev/null +++ b/js/src/tests/test262/language/future-reserved-words/final.js @@ -0,0 +1,14 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-future-reserved-words +es5id: 7.6.1.2_A1.12 +description: Checking if execution of "final=1" succeeds +info: | + `final` was removed from the list of future reserved words in ECMAScript 5. +---*/ + +var final = 1; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/future-reserved-words/float.js b/js/src/tests/test262/language/future-reserved-words/float.js new file mode 100644 index 0000000000..3e3be01689 --- /dev/null +++ b/js/src/tests/test262/language/future-reserved-words/float.js @@ -0,0 +1,14 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-future-reserved-words +es5id: 7.6.1.2_A1.13 +description: Checking if execution of "float=1" succeeds +info: | + `float` was removed from the list of future reserved words in ECMAScript 5. +---*/ + +var float = 1; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/future-reserved-words/goto.js b/js/src/tests/test262/language/future-reserved-words/goto.js new file mode 100644 index 0000000000..dda0526f55 --- /dev/null +++ b/js/src/tests/test262/language/future-reserved-words/goto.js @@ -0,0 +1,14 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-future-reserved-words +es5id: 7.6.1.2_A1.14 +description: Checking if execution of "goto=1" succeeds +info: | + `goto` was removed from the list of future reserved words in ECMAScript 5. +---*/ + +var goto = 1; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/future-reserved-words/implement.js b/js/src/tests/test262/language/future-reserved-words/implement.js new file mode 100644 index 0000000000..6da805ccde --- /dev/null +++ b/js/src/tests/test262/language/future-reserved-words/implement.js @@ -0,0 +1,14 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 7.6.1.2-12-s +description: > + SyntaxError isn't thrown when 'implement' occurs +---*/ + +var implement = 1; + +assert.sameValue(implement, 1, 'implement'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/future-reserved-words/implements-strict-escaped-strict.js b/js/src/tests/test262/language/future-reserved-words/implements-strict-escaped-strict.js new file mode 100644 index 0000000000..8b40f86e49 --- /dev/null +++ b/js/src/tests/test262/language/future-reserved-words/implements-strict-escaped-strict.js @@ -0,0 +1,26 @@ +// |reftest| error:SyntaxError +'use strict'; +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-identifiers-static-semantics-early-errors +es5id: 7.6.1-17-s +description: > + 7.6 - SyntaxError expected: reserved words used as Identifier + Names in UTF8: implements (implements) +info: | + Identifier : IdentifierName but not ReservedWord + + It is a Syntax Error if this phrase is contained in strict mode code and the + StringValue of IdentifierName is: "implements", "interface", "let", "package", + "private", "protected", "public", "static", or "yield". +negative: + phase: parse + type: SyntaxError +flags: [onlyStrict] +---*/ + +$DONOTEVALUATE(); + +var \u0069mplements = 123; diff --git a/js/src/tests/test262/language/future-reserved-words/implements-strict-strict.js b/js/src/tests/test262/language/future-reserved-words/implements-strict-strict.js new file mode 100644 index 0000000000..2f23f85e74 --- /dev/null +++ b/js/src/tests/test262/language/future-reserved-words/implements-strict-strict.js @@ -0,0 +1,25 @@ +// |reftest| error:SyntaxError +'use strict'; +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-identifiers-static-semantics-early-errors +es5id: 7.6.1.2-1-s +description: > + Strict Mode - SyntaxError is thrown when 'implements' occurs in strict mode code +info: | + Identifier : IdentifierName but not ReservedWord + + It is a Syntax Error if this phrase is contained in strict mode code and the + StringValue of IdentifierName is: "implements", "interface", "let", "package", + "private", "protected", "public", "static", or "yield". +negative: + phase: parse + type: SyntaxError +flags: [onlyStrict] +---*/ + +$DONOTEVALUATE(); + +var implements = 1; diff --git a/js/src/tests/test262/language/future-reserved-words/implements-titlecase.js b/js/src/tests/test262/language/future-reserved-words/implements-titlecase.js new file mode 100644 index 0000000000..bc498dbaf6 --- /dev/null +++ b/js/src/tests/test262/language/future-reserved-words/implements-titlecase.js @@ -0,0 +1,14 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 7.6.1.2-11-s +description: > + SyntaxError isn't thrown when 'Implements' occurs +---*/ + +var Implements = 1; + +assert.sameValue(Implements, 1, 'Implements'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/future-reserved-words/implements-uppercase.js b/js/src/tests/test262/language/future-reserved-words/implements-uppercase.js new file mode 100644 index 0000000000..f79157e845 --- /dev/null +++ b/js/src/tests/test262/language/future-reserved-words/implements-uppercase.js @@ -0,0 +1,14 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 7.6.1.2-10-s +description: > + SyntaxError isn't thrown when 'IMPLEMENTS' occurs +---*/ + +var IMPLEMENTS = 1; + +assert.sameValue(IMPLEMENTS, 1, 'IMPLEMENTS'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/future-reserved-words/implements.js b/js/src/tests/test262/language/future-reserved-words/implements.js new file mode 100644 index 0000000000..b2ef5e599a --- /dev/null +++ b/js/src/tests/test262/language/future-reserved-words/implements.js @@ -0,0 +1,13 @@ +// Copyright 2011 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: The "implements" token can be used as identifier in non-strict code +es5id: 7.6.1.2_A1.15ns +description: Checking if execution of "implements=1" succeeds in non-strict code +flags: [noStrict] +---*/ + +var implements = 1; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/future-reserved-words/implements0.js b/js/src/tests/test262/language/future-reserved-words/implements0.js new file mode 100644 index 0000000000..bcd7afd910 --- /dev/null +++ b/js/src/tests/test262/language/future-reserved-words/implements0.js @@ -0,0 +1,14 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 7.6.1.2-14-s +description: > + SyntaxError isn't thrown when 'implements0' occurs +---*/ + +var implements0 = 1; + +assert.sameValue(implements0, 1, 'implements0'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/future-reserved-words/implementss.js b/js/src/tests/test262/language/future-reserved-words/implementss.js new file mode 100644 index 0000000000..32969a58eb --- /dev/null +++ b/js/src/tests/test262/language/future-reserved-words/implementss.js @@ -0,0 +1,14 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 7.6.1.2-13-s +description: > + SyntaxError isn't thrown when 'implementss' occurs +---*/ + +var implementss = 1; + +assert.sameValue(implementss, 1, 'implementss'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/future-reserved-words/import.js b/js/src/tests/test262/language/future-reserved-words/import.js new file mode 100644 index 0000000000..5ac16df5b3 --- /dev/null +++ b/js/src/tests/test262/language/future-reserved-words/import.js @@ -0,0 +1,21 @@ +// |reftest| error:SyntaxError +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-identifiers-static-semantics-early-errors +es5id: 7.6.1.2_A1.16 +description: Checking if execution of "import=1" fails +info: | + Identifier : IdentifierName but not ReservedWord + + It is a Syntax Error if StringValue of IdentifierName is the same String + value as the StringValue of any ReservedWord except for yield and await. +negative: + phase: parse + type: SyntaxError +---*/ + +$DONOTEVALUATE(); + +var import = 1; diff --git a/js/src/tests/test262/language/future-reserved-words/int.js b/js/src/tests/test262/language/future-reserved-words/int.js new file mode 100644 index 0000000000..0d8433fdc6 --- /dev/null +++ b/js/src/tests/test262/language/future-reserved-words/int.js @@ -0,0 +1,14 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-future-reserved-words +es5id: 7.6.1.2_A1.17 +description: Checking if execution of "int=1" succeeds +info: | + `int` was removed from the list of future reserved words in ECMAScript 5. +---*/ + +var int = 1; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/future-reserved-words/interface-strict-escaped-strict.js b/js/src/tests/test262/language/future-reserved-words/interface-strict-escaped-strict.js new file mode 100644 index 0000000000..5567519b92 --- /dev/null +++ b/js/src/tests/test262/language/future-reserved-words/interface-strict-escaped-strict.js @@ -0,0 +1,26 @@ +// |reftest| error:SyntaxError +'use strict'; +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-identifiers-static-semantics-early-errors +es5id: 7.6.1-22-s +description: > + 7.6 - SyntaxError expected: reserved words used as Identifier + Names in UTF8: inte\u0072face (interface) +info: | + Identifier : IdentifierName but not ReservedWord + + It is a Syntax Error if this phrase is contained in strict mode code and the + StringValue of IdentifierName is: "implements", "interface", "let", "package", + "private", "protected", "public", "static", or "yield". +negative: + phase: parse + type: SyntaxError +flags: [onlyStrict] +---*/ + +$DONOTEVALUATE(); + +var inte\u0072face = 123; diff --git a/js/src/tests/test262/language/future-reserved-words/interface-strict-strict.js b/js/src/tests/test262/language/future-reserved-words/interface-strict-strict.js new file mode 100644 index 0000000000..121c33a9e4 --- /dev/null +++ b/js/src/tests/test262/language/future-reserved-words/interface-strict-strict.js @@ -0,0 +1,25 @@ +// |reftest| error:SyntaxError +'use strict'; +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-identifiers-static-semantics-early-errors +es5id: 7.6.1.2-6-s +description: > + Strict Mode - SyntaxError is thrown when 'interface' occurs in strict mode code +info: | + Identifier : IdentifierName but not ReservedWord + + It is a Syntax Error if this phrase is contained in strict mode code and the + StringValue of IdentifierName is: "implements", "interface", "let", "package", + "private", "protected", "public", "static", or "yield". +negative: + phase: parse + type: SyntaxError +flags: [onlyStrict] +---*/ + +$DONOTEVALUATE(); + +var interface = 1; diff --git a/js/src/tests/test262/language/future-reserved-words/interface.js b/js/src/tests/test262/language/future-reserved-words/interface.js new file mode 100644 index 0000000000..3de776ec12 --- /dev/null +++ b/js/src/tests/test262/language/future-reserved-words/interface.js @@ -0,0 +1,17 @@ +// Copyright 2011 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: | + The "interface" token can be used as identifier in + non-strict code +es5id: 7.6.1.2_A1.18ns +description: > + Checking if execution of "interface = 1" succeeds in non-strict + code +flags: [noStrict] +---*/ + +var interface = 1; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/future-reserved-words/let-strict-escaped-strict.js b/js/src/tests/test262/language/future-reserved-words/let-strict-escaped-strict.js new file mode 100644 index 0000000000..181a69f019 --- /dev/null +++ b/js/src/tests/test262/language/future-reserved-words/let-strict-escaped-strict.js @@ -0,0 +1,26 @@ +// |reftest| error:SyntaxError +'use strict'; +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-identifiers-static-semantics-early-errors +es5id: 7.6.1-18-s +description: > + 7.6 - SyntaxError expected: reserved words used as Identifier + Names in UTF8: l\u0065t (let) +info: | + Identifier : IdentifierName but not ReservedWord + + It is a Syntax Error if this phrase is contained in strict mode code and the + StringValue of IdentifierName is: "implements", "interface", "let", "package", + "private", "protected", "public", "static", or "yield". +negative: + phase: parse + type: SyntaxError +flags: [onlyStrict] +---*/ + +$DONOTEVALUATE(); + +var l\u0065t = 123; diff --git a/js/src/tests/test262/language/future-reserved-words/let-strict-strict.js b/js/src/tests/test262/language/future-reserved-words/let-strict-strict.js new file mode 100644 index 0000000000..38cac24a82 --- /dev/null +++ b/js/src/tests/test262/language/future-reserved-words/let-strict-strict.js @@ -0,0 +1,25 @@ +// |reftest| error:SyntaxError +'use strict'; +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-identifiers-static-semantics-early-errors +es5id: 7.6.1.2-2-s +description: > + Strict Mode - SyntaxError is thrown when 'let' occurs in strict mode code +info: | + Identifier : IdentifierName but not ReservedWord + + It is a Syntax Error if this phrase is contained in strict mode code and the + StringValue of IdentifierName is: "implements", "interface", "let", "package", + "private", "protected", "public", "static", or "yield". +negative: + phase: parse + type: SyntaxError +flags: [onlyStrict] +---*/ + +$DONOTEVALUATE(); + +var let = 1; diff --git a/js/src/tests/test262/language/future-reserved-words/long.js b/js/src/tests/test262/language/future-reserved-words/long.js new file mode 100644 index 0000000000..66702cfa17 --- /dev/null +++ b/js/src/tests/test262/language/future-reserved-words/long.js @@ -0,0 +1,14 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-future-reserved-words +es5id: 7.6.1.2_A1.19 +description: Checking if execution of "long=1" succeeds +info: | + `long` was removed from the list of future reserved words in ECMAScript 5. +---*/ + +var long = 1; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/future-reserved-words/native.js b/js/src/tests/test262/language/future-reserved-words/native.js new file mode 100644 index 0000000000..ad0436cd5d --- /dev/null +++ b/js/src/tests/test262/language/future-reserved-words/native.js @@ -0,0 +1,14 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-future-reserved-words +es5id: 7.6.1.2_A1.20 +description: Checking if execution of "native=1" succeeds +info: | + `native` was removed from the list of future reserved words in ECMAScript 5. +---*/ + +var native = 1; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/future-reserved-words/package-strict-escaped-strict.js b/js/src/tests/test262/language/future-reserved-words/package-strict-escaped-strict.js new file mode 100644 index 0000000000..1c51214658 --- /dev/null +++ b/js/src/tests/test262/language/future-reserved-words/package-strict-escaped-strict.js @@ -0,0 +1,26 @@ +// |reftest| error:SyntaxError +'use strict'; +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-identifiers-static-semantics-early-errors +es5id: 7.6.1-23-s +description: > + 7.6 - SyntaxError expected: reserved words used as Identifier + Names in UTF8: packag\u0065 (package) +info: | + Identifier : IdentifierName but not ReservedWord + + It is a Syntax Error if this phrase is contained in strict mode code and the + StringValue of IdentifierName is: "implements", "interface", "let", "package", + "private", "protected", "public", "static", or "yield". +negative: + phase: parse + type: SyntaxError +flags: [onlyStrict] +---*/ + +$DONOTEVALUATE(); + +var packag\u0065 = 123; diff --git a/js/src/tests/test262/language/future-reserved-words/package-strict-strict.js b/js/src/tests/test262/language/future-reserved-words/package-strict-strict.js new file mode 100644 index 0000000000..97cf308b40 --- /dev/null +++ b/js/src/tests/test262/language/future-reserved-words/package-strict-strict.js @@ -0,0 +1,25 @@ +// |reftest| error:SyntaxError +'use strict'; +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-identifiers-static-semantics-early-errors +es5id: 7.6.1.2-7-s +description: > + Strict Mode - SyntaxError is thrown when 'package' occurs in strict mode code +info: | + Identifier : IdentifierName but not ReservedWord + + It is a Syntax Error if this phrase is contained in strict mode code and the + StringValue of IdentifierName is: "implements", "interface", "let", "package", + "private", "protected", "public", "static", or "yield". +negative: + phase: parse + type: SyntaxError +flags: [onlyStrict] +---*/ + +$DONOTEVALUATE(); + +var package = 1; diff --git a/js/src/tests/test262/language/future-reserved-words/package.js b/js/src/tests/test262/language/future-reserved-words/package.js new file mode 100644 index 0000000000..93290f5cb8 --- /dev/null +++ b/js/src/tests/test262/language/future-reserved-words/package.js @@ -0,0 +1,13 @@ +// Copyright 2011 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: The "package" token can be used as identifier in non-strict code +es5id: 7.6.1.2_A1.21ns +description: Checking if execution of "package=1" succeeds in non-strict code +flags: [noStrict] +---*/ + +var package = 1; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/future-reserved-words/private-strict-escaped-strict.js b/js/src/tests/test262/language/future-reserved-words/private-strict-escaped-strict.js new file mode 100644 index 0000000000..d4e4eec583 --- /dev/null +++ b/js/src/tests/test262/language/future-reserved-words/private-strict-escaped-strict.js @@ -0,0 +1,26 @@ +// |reftest| error:SyntaxError +'use strict'; +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-identifiers-static-semantics-early-errors +es5id: 7.6.1-19-s +description: > + 7.6 - SyntaxError expected: reserved words used as Identifier + Names in UTF8: privat\u0065 (private) +info: | + Identifier : IdentifierName but not ReservedWord + + It is a Syntax Error if this phrase is contained in strict mode code and the + StringValue of IdentifierName is: "implements", "interface", "let", "package", + "private", "protected", "public", "static", or "yield". +negative: + phase: parse + type: SyntaxError +flags: [onlyStrict] +---*/ + +$DONOTEVALUATE(); + +var privat\u0065 = 123; diff --git a/js/src/tests/test262/language/future-reserved-words/private-strict-strict.js b/js/src/tests/test262/language/future-reserved-words/private-strict-strict.js new file mode 100644 index 0000000000..7087975cfd --- /dev/null +++ b/js/src/tests/test262/language/future-reserved-words/private-strict-strict.js @@ -0,0 +1,25 @@ +// |reftest| error:SyntaxError +'use strict'; +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-identifiers-static-semantics-early-errors +es5id: 7.6.1.2-3-s +description: > + Strict Mode - SyntaxError is thrown when 'private' occurs in strict mode code +info: | + Identifier : IdentifierName but not ReservedWord + + It is a Syntax Error if this phrase is contained in strict mode code and the + StringValue of IdentifierName is: "implements", "interface", "let", "package", + "private", "protected", "public", "static", or "yield". +negative: + phase: parse + type: SyntaxError +flags: [onlyStrict] +---*/ + +$DONOTEVALUATE(); + +var private = 1; diff --git a/js/src/tests/test262/language/future-reserved-words/private.js b/js/src/tests/test262/language/future-reserved-words/private.js new file mode 100644 index 0000000000..0a5960e6cb --- /dev/null +++ b/js/src/tests/test262/language/future-reserved-words/private.js @@ -0,0 +1,13 @@ +// Copyright 2011 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: The "private" token can be used as identifier in non-strict code +es5id: 7.6.1.2_A1.22ns +description: Checking if execution of "private=1" succeeds in non-strict code +flags: [noStrict] +---*/ + +var private = 1; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/future-reserved-words/protected-strict-escaped-strict.js b/js/src/tests/test262/language/future-reserved-words/protected-strict-escaped-strict.js new file mode 100644 index 0000000000..46537ad579 --- /dev/null +++ b/js/src/tests/test262/language/future-reserved-words/protected-strict-escaped-strict.js @@ -0,0 +1,27 @@ +// |reftest| error:SyntaxError +'use strict'; +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-identifiers-static-semantics-early-errors +es5id: 7.6.1-24-s +description: > + 7.6 - SyntaxError expected: reserved words used as Identifier + Names in UTF8: + \u0070\u0072\u006f\u0074\u0065\u0063\u0074\u0065\u0064 (protected) +info: | + Identifier : IdentifierName but not ReservedWord + + It is a Syntax Error if this phrase is contained in strict mode code and the + StringValue of IdentifierName is: "implements", "interface", "let", "package", + "private", "protected", "public", "static", or "yield". +negative: + phase: parse + type: SyntaxError +flags: [onlyStrict] +---*/ + +$DONOTEVALUATE(); + +var \u0070\u0072\u006f\u0074\u0065\u0063\u0074\u0065\u0064 = 123; diff --git a/js/src/tests/test262/language/future-reserved-words/protected-strict-strict.js b/js/src/tests/test262/language/future-reserved-words/protected-strict-strict.js new file mode 100644 index 0000000000..dcf988d8e6 --- /dev/null +++ b/js/src/tests/test262/language/future-reserved-words/protected-strict-strict.js @@ -0,0 +1,25 @@ +// |reftest| error:SyntaxError +'use strict'; +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-identifiers-static-semantics-early-errors +es5id: 7.6.1.2-8-s +description: > + Strict Mode - SyntaxError is thrown when 'protected' occurs in strict mode code +info: | + Identifier : IdentifierName but not ReservedWord + + It is a Syntax Error if this phrase is contained in strict mode code and the + StringValue of IdentifierName is: "implements", "interface", "let", "package", + "private", "protected", "public", "static", or "yield". +negative: + phase: parse + type: SyntaxError +flags: [onlyStrict] +---*/ + +$DONOTEVALUATE(); + +var protected = 1; diff --git a/js/src/tests/test262/language/future-reserved-words/protected.js b/js/src/tests/test262/language/future-reserved-words/protected.js new file mode 100644 index 0000000000..3079bd4d78 --- /dev/null +++ b/js/src/tests/test262/language/future-reserved-words/protected.js @@ -0,0 +1,13 @@ +// Copyright 2011 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: The "protected" token can be used as identifier in non-strict code +es5id: 7.6.1.2_A1.23ns +description: Checking if execution of "protected=1" succeeds in non-strict code +flags: [noStrict] +---*/ + +var protected = 1; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/future-reserved-words/public-strict-escaped-strict.js b/js/src/tests/test262/language/future-reserved-words/public-strict-escaped-strict.js new file mode 100644 index 0000000000..fd1be71dcb --- /dev/null +++ b/js/src/tests/test262/language/future-reserved-words/public-strict-escaped-strict.js @@ -0,0 +1,26 @@ +// |reftest| error:SyntaxError +'use strict'; +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-identifiers-static-semantics-early-errors +es5id: 7.6.1-20-s +description: > + 7.6 - SyntaxError expected: reserved words used as Identifier + Names in UTF8: \u0070\u0075\u0062\u006c\u0069\u0063 (public) +info: | + Identifier : IdentifierName but not ReservedWord + + It is a Syntax Error if this phrase is contained in strict mode code and the + StringValue of IdentifierName is: "implements", "interface", "let", "package", + "private", "protected", "public", "static", or "yield". +negative: + phase: parse + type: SyntaxError +flags: [onlyStrict] +---*/ + +$DONOTEVALUATE(); + +var \u0070\u0075\u0062\u006c\u0069\u0063 = 123; diff --git a/js/src/tests/test262/language/future-reserved-words/public-strict-strict.js b/js/src/tests/test262/language/future-reserved-words/public-strict-strict.js new file mode 100644 index 0000000000..ea9986baf1 --- /dev/null +++ b/js/src/tests/test262/language/future-reserved-words/public-strict-strict.js @@ -0,0 +1,25 @@ +// |reftest| error:SyntaxError +'use strict'; +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-identifiers-static-semantics-early-errors +es5id: 7.6.1.2-4-s +description: > + Strict Mode - SyntaxError is thrown when 'public' occurs in strict mode code +info: | + Identifier : IdentifierName but not ReservedWord + + It is a Syntax Error if this phrase is contained in strict mode code and the + StringValue of IdentifierName is: "implements", "interface", "let", "package", + "private", "protected", "public", "static", or "yield". +negative: + phase: parse + type: SyntaxError +flags: [onlyStrict] +---*/ + +$DONOTEVALUATE(); + +var public = 1; diff --git a/js/src/tests/test262/language/future-reserved-words/public.js b/js/src/tests/test262/language/future-reserved-words/public.js new file mode 100644 index 0000000000..8dcf9bff70 --- /dev/null +++ b/js/src/tests/test262/language/future-reserved-words/public.js @@ -0,0 +1,13 @@ +// Copyright 2011 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: The "public" token can be used as identifier in non-strict code +es5id: 7.6.1.2_A1.24ns +description: Checking if execution of "public=1" succeeds in non-strict code +flags: [noStrict] +---*/ + +var public = 1; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/future-reserved-words/shell.js b/js/src/tests/test262/language/future-reserved-words/shell.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/js/src/tests/test262/language/future-reserved-words/shell.js diff --git a/js/src/tests/test262/language/future-reserved-words/short.js b/js/src/tests/test262/language/future-reserved-words/short.js new file mode 100644 index 0000000000..c7366d5805 --- /dev/null +++ b/js/src/tests/test262/language/future-reserved-words/short.js @@ -0,0 +1,14 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-future-reserved-words +es5id: 7.6.1.2_A1.25 +description: Checking if execution of "short=1" succeeds +info: | + `short` was removed from the list of future reserved words in ECMAScript 5. +---*/ + +var short = 1; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/future-reserved-words/static-strict-escaped-strict.js b/js/src/tests/test262/language/future-reserved-words/static-strict-escaped-strict.js new file mode 100644 index 0000000000..227e3aee17 --- /dev/null +++ b/js/src/tests/test262/language/future-reserved-words/static-strict-escaped-strict.js @@ -0,0 +1,26 @@ +// |reftest| error:SyntaxError +'use strict'; +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-identifiers-static-semantics-early-errors +es5id: 7.6.1-25-s +description: > + 7.6 - SyntaxError expected: reserved words used as Identifier + Names in UTF8: \u0073\u0074\u0061\u0074\u0069\u0063 (static) +info: | + Identifier : IdentifierName but not ReservedWord + + It is a Syntax Error if this phrase is contained in strict mode code and the + StringValue of IdentifierName is: "implements", "interface", "let", "package", + "private", "protected", "public", "static", or "yield". +negative: + phase: parse + type: SyntaxError +flags: [onlyStrict] +---*/ + +$DONOTEVALUATE(); + +var \u0073\u0074\u0061\u0074\u0069\u0063 = 123; diff --git a/js/src/tests/test262/language/future-reserved-words/static-strict-strict.js b/js/src/tests/test262/language/future-reserved-words/static-strict-strict.js new file mode 100644 index 0000000000..43de91e498 --- /dev/null +++ b/js/src/tests/test262/language/future-reserved-words/static-strict-strict.js @@ -0,0 +1,25 @@ +// |reftest| error:SyntaxError +'use strict'; +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-identifiers-static-semantics-early-errors +es5id: 7.6.1.2-9-s +description: > + Strict Mode - SyntaxError is thrown when 'static' occurs in strict mode code +info: | + Identifier : IdentifierName but not ReservedWord + + It is a Syntax Error if this phrase is contained in strict mode code and the + StringValue of IdentifierName is: "implements", "interface", "let", "package", + "private", "protected", "public", "static", or "yield". +negative: + phase: parse + type: SyntaxError +flags: [onlyStrict] +---*/ + +$DONOTEVALUATE(); + +var static = 1; diff --git a/js/src/tests/test262/language/future-reserved-words/static.js b/js/src/tests/test262/language/future-reserved-words/static.js new file mode 100644 index 0000000000..b3ebdb7cf2 --- /dev/null +++ b/js/src/tests/test262/language/future-reserved-words/static.js @@ -0,0 +1,13 @@ +// Copyright 2011 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: The "static" token can be used as identifier in non-strict code +es5id: 7.6.1.2_A1.26ns +description: Checking if execution of "static=1" succeeds in non-strict code +flags: [noStrict] +---*/ + +var static = 1; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/future-reserved-words/super.js b/js/src/tests/test262/language/future-reserved-words/super.js new file mode 100644 index 0000000000..ba030f2c38 --- /dev/null +++ b/js/src/tests/test262/language/future-reserved-words/super.js @@ -0,0 +1,21 @@ +// |reftest| error:SyntaxError +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-identifiers-static-semantics-early-errors +es5id: 7.6.1.2_A1.27 +description: Checking if execution of "super=1" fails +info: | + Identifier : IdentifierName but not ReservedWord + + It is a Syntax Error if StringValue of IdentifierName is the same String + value as the StringValue of any ReservedWord except for yield and await. +negative: + phase: parse + type: SyntaxError +---*/ + +$DONOTEVALUATE(); + +var super = 1; diff --git a/js/src/tests/test262/language/future-reserved-words/synchronized.js b/js/src/tests/test262/language/future-reserved-words/synchronized.js new file mode 100644 index 0000000000..80d762f977 --- /dev/null +++ b/js/src/tests/test262/language/future-reserved-words/synchronized.js @@ -0,0 +1,14 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-future-reserved-words +es5id: 7.6.1.2_A1.28 +description: Checking if execution of "synchronized=1" succeeds +info: | + `synchronized` was removed from the list of future reserved words in ECMAScript 5. +---*/ + +var synchronized = 1; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/future-reserved-words/throws.js b/js/src/tests/test262/language/future-reserved-words/throws.js new file mode 100644 index 0000000000..463336db84 --- /dev/null +++ b/js/src/tests/test262/language/future-reserved-words/throws.js @@ -0,0 +1,14 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-future-reserved-words +es5id: 7.6.1.2_A1.29 +description: Checking if execution of "throws=1" succeeds +info: | + `throws` was removed from the list of future reserved words in ECMAScript 5. +---*/ + +var throws = 1; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/future-reserved-words/transient.js b/js/src/tests/test262/language/future-reserved-words/transient.js new file mode 100644 index 0000000000..f5ad06b512 --- /dev/null +++ b/js/src/tests/test262/language/future-reserved-words/transient.js @@ -0,0 +1,14 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-future-reserved-words +es5id: 7.6.1.2_A1.30 +description: Checking if execution of "transient=1" succeeds +info: | + `transient` was removed from the list of future reserved words in ECMAScript 5. +---*/ + +var transient = 1; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/future-reserved-words/volatile.js b/js/src/tests/test262/language/future-reserved-words/volatile.js new file mode 100644 index 0000000000..1be6779ba8 --- /dev/null +++ b/js/src/tests/test262/language/future-reserved-words/volatile.js @@ -0,0 +1,14 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-future-reserved-words +es5id: 7.6.1.2_A1.31 +description: Checking if execution of "volatile=1" succeeds +info: | + `volatile` was removed from the list of future reserved words in ECMAScript 5. +---*/ + +var volatile = 1; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/future-reserved-words/yield-strict-escaped-strict.js b/js/src/tests/test262/language/future-reserved-words/yield-strict-escaped-strict.js new file mode 100644 index 0000000000..0239f42cfa --- /dev/null +++ b/js/src/tests/test262/language/future-reserved-words/yield-strict-escaped-strict.js @@ -0,0 +1,26 @@ +// |reftest| error:SyntaxError +'use strict'; +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-identifiers-static-semantics-early-errors +es5id: 7.6.1-21-s +description: > + 7.6 - SyntaxError expected: reserved words used as Identifier + Names in UTF8: \u0079ield (yield) +info: | + Identifier : IdentifierName but not ReservedWord + + It is a Syntax Error if this phrase is contained in strict mode code and the + StringValue of IdentifierName is: "implements", "interface", "let", "package", + "private", "protected", "public", "static", or "yield". +negative: + phase: parse + type: SyntaxError +flags: [onlyStrict] +---*/ + +$DONOTEVALUATE(); + +var \u0079ield = 123; diff --git a/js/src/tests/test262/language/future-reserved-words/yield-strict-strict.js b/js/src/tests/test262/language/future-reserved-words/yield-strict-strict.js new file mode 100644 index 0000000000..f91d0a6b5a --- /dev/null +++ b/js/src/tests/test262/language/future-reserved-words/yield-strict-strict.js @@ -0,0 +1,24 @@ +// |reftest| error:SyntaxError +'use strict'; +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-identifiers-static-semantics-early-errors +es5id: 7.6.1.2-5-s +description: > + Strict Mode - SyntaxError is thrown when ReservedWord + 'yield' occurs in strict mode code +info: | + BindingIdentifier : yield + + It is a Syntax Error if the code matched by this production is contained in strict mode code. +negative: + phase: parse + type: SyntaxError +flags: [onlyStrict] +---*/ + +$DONOTEVALUATE(); + +var yield = 1; |