diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2009-03-03 19:30:52 -0800 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-03-03 19:30:52 -0800 |
commit | 8e35f3cfc7fba1d1c829dc557ebad6409cbe16a2 (patch) | |
tree | 11425ea0b299d6fb89c6d3618a22d97d5bf68d0f /JavaScriptCore/tests/mozilla/ecma/LexicalConventions | |
parent | 648161bb0edfc3d43db63caed5cc5213bc6cb78f (diff) | |
download | external_webkit-8e35f3cfc7fba1d1c829dc557ebad6409cbe16a2.zip external_webkit-8e35f3cfc7fba1d1c829dc557ebad6409cbe16a2.tar.gz external_webkit-8e35f3cfc7fba1d1c829dc557ebad6409cbe16a2.tar.bz2 |
auto import from //depot/cupcake/@135843
Diffstat (limited to 'JavaScriptCore/tests/mozilla/ecma/LexicalConventions')
75 files changed, 6227 insertions, 0 deletions
diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.1-1.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.1-1.js new file mode 100644 index 0000000..d801063 --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.1-1.js @@ -0,0 +1,86 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.1-1.js + ECMA Section: 7.1 White Space + Description: - readability + - separate tokens + - otherwise should be insignificant + - in strings, white space characters are significant + - cannot appear within any other kind of token + + white space characters are: + unicode name formal name string representation + \u0009 tab <TAB> \t + \u000B veritical tab <VT> \v + \U000C form feed <FF> \f + \u0020 space <SP> " " + + Author: christine@netscape.com + Date: 11 september 1997 +*/ + + var SECTION = "7.1-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "White Space"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + + // whitespace between var keyword and identifier + + array[item++] = new TestCase( SECTION, 'var'+'\t'+'MYVAR1=10;MYVAR1', 10, eval('var'+'\t'+'MYVAR1=10;MYVAR1') ); + array[item++] = new TestCase( SECTION, 'var'+'\f'+'MYVAR2=10;MYVAR2', 10, eval('var'+'\f'+'MYVAR2=10;MYVAR2') ); + array[item++] = new TestCase( SECTION, 'var'+'\v'+'MYVAR2=10;MYVAR2', 10, eval('var'+'\v'+'MYVAR2=10;MYVAR2') ); + array[item++] = new TestCase( SECTION, 'var'+'\ '+'MYVAR2=10;MYVAR2', 10, eval('var'+'\ '+'MYVAR2=10;MYVAR2') ); + + // use whitespace between tokens object name, dot operator, and object property + + array[item++] = new TestCase( SECTION, + "var a = new Array(12345); a\t\v\f .\\u0009\\000B\\u000C\\u0020length", + 12345, + eval("var a = new Array(12345); a\t\v\f .\u0009\u0020\u000C\u000Blength") ); + + + return ( array ); +} +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; + } + stopTest(); + return ( testcases ); +}
\ No newline at end of file diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.1-2.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.1-2.js new file mode 100644 index 0000000..04da3c9 --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.1-2.js @@ -0,0 +1,74 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.1-2.js + ECMA Section: 7.1 White Space + Description: - readability + - separate tokens + - otherwise should be insignificant + - in strings, white space characters are significant + - cannot appear within any other kind of token + + white space characters are: + unicode name formal name string representation + \u0009 tab <TAB> \t + \u000B veritical tab <VT> ?? + \U000C form feed <FF> \f + \u0020 space <SP> " " + + Author: christine@netscape.com + Date: 11 september 1997 +*/ + + var SECTION = "7.1-2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "White Space"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, "'var'+'\u000B'+'MYVAR1=10;MYVAR1'", 10, eval('var'+'\u000B'+'MYVAR1=10;MYVAR1') ); + array[item++] = new TestCase( SECTION, "'var'+'\u0009'+'MYVAR2=10;MYVAR2'", 10, eval('var'+'\u0009'+'MYVAR2=10;MYVAR2') ); + array[item++] = new TestCase( SECTION, "'var'+'\u000C'+'MYVAR3=10;MYVAR3'", 10, eval('var'+'\u000C'+'MYVAR3=10;MYVAR3') ); + array[item++] = new TestCase( SECTION, "'var'+'\u0020'+'MYVAR4=10;MYVAR4'", 10, eval('var'+'\u0020'+'MYVAR4=10;MYVAR4') ); + + return ( array ); +} +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; + } + stopTest(); + return ( testcases ); +}
\ No newline at end of file diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.1-3.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.1-3.js new file mode 100644 index 0000000..c9c6ae1 --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.1-3.js @@ -0,0 +1,92 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.1-3.js + ECMA Section: 7.1 White Space + Description: - readability + - separate tokens + - otherwise should be insignificant + - in strings, white space characters are significant + - cannot appear within any other kind of token + + white space characters are: + unicode name formal name string representation + \u0009 tab <TAB> \t + \u000B veritical tab <VT> ?? + \U000C form feed <FF> \f + \u0020 space <SP> " " + + Author: christine@netscape.com + Date: 11 september 1997 +*/ + + var SECTION = "7.1-3"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "White Space"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, "'var'+'\u000B'+'MYVAR1=10;MYVAR1'", 10, eval('var'+'\u000B'+'MYVAR1=10;MYVAR1') ); + array[item++] = new TestCase( SECTION, "'var'+'\u0009'+'MYVAR2=10;MYVAR2'", 10, eval('var'+'\u0009'+'MYVAR2=10;MYVAR2') ); + array[item++] = new TestCase( SECTION, "'var'+'\u000C'+'MYVAR3=10;MYVAR3'", 10, eval('var'+'\u000C'+'MYVAR3=10;MYVAR3') ); + array[item++] = new TestCase( SECTION, "'var'+'\u0020'+'MYVAR4=10;MYVAR4'", 10, eval('var'+'\u0020'+'MYVAR4=10;MYVAR4') ); + + // +<white space>+ should be interpreted as the unary + operator twice, not as a post or prefix increment operator + + array[item++] = new TestCase( SECTION, + "var VAR = 12345; + + VAR", + 12345, + eval("var VAR = 12345; + + VAR") ); + + array[item++] = new TestCase( SECTION, + "var VAR = 12345;VAR+ + VAR", + 24690, + eval("var VAR = 12345;VAR+ +VAR") ); + array[item++] = new TestCase( SECTION, + "var VAR = 12345;VAR - - VAR", + 24690, + eval("var VAR = 12345;VAR- -VAR") ); + + + return ( array ); +} +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.2-1.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.2-1.js new file mode 100644 index 0000000..4936984 --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.2-1.js @@ -0,0 +1,75 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.2-1.js + ECMA Section: 7.2 Line Terminators + Description: - readability + - separate tokens + - may occur between any two tokens + - cannot occur within any token, not even a string + - affect the process of automatic semicolon insertion. + + white space characters are: + unicode name formal name string representation + \u000A line feed <LF> \n + \u000D carriage return <CR> \r + + Author: christine@netscape.com + Date: 11 september 1997 +*/ + var SECTION = "7.2-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Line Terminators"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "var a\nb = 5; ab=10;ab;", 10, eval("var a\nb = 5; ab=10;ab") ); + array[item++] = new TestCase( SECTION, "var a\nb = 5; ab=10;b;", 5, eval("var a\nb = 5; ab=10;b") ); + array[item++] = new TestCase( SECTION, "var a\rb = 5; ab=10;ab;", 10, eval("var a\rb = 5; ab=10;ab") ); + array[item++] = new TestCase( SECTION, "var a\rb = 5; ab=10;b;", 5, eval("var a\rb = 5; ab=10;b") ); + array[item++] = new TestCase( SECTION, "var a\r\nb = 5; ab=10;ab;", 10, eval("var a\r\nb = 5; ab=10;ab") ); + array[item++] = new TestCase( SECTION, "var a\r\nb = 5; ab=10;b;", 5, eval("var a\r\nb = 5; ab=10;b") ); + + return ( array ); +} + +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.2-2-n.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.2-2-n.js new file mode 100644 index 0000000..268fc56 --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.2-2-n.js @@ -0,0 +1,80 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.2.js + ECMA Section: 7.2 Line Terminators + Description: - readability + - separate tokens + - may occur between any two tokens + - cannot occur within any token, not even a string + - affect the process of automatic semicolon insertion. + + white space characters are: + unicode name formal name string representation + \u000A line feed <LF> \n + \u000D carriage return <CR> \r + + this test uses onerror to capture line numbers. because + we use on error, we can only have one test case per file. + + Author: christine@netscape.com + Date: 11 september 1997 +*/ + var SECTION = "7.2-2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Line Terminators"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function test() { + // this is line 29 + a = "\r\r\r\nb"; + eval( a ); + + // if we get this far, the test failed. + testcases[tc].passed = writeTestCaseResult( + "failure on line" + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ testcases[tc].actual ); + + testcases[0].passed = false; + + testcases[tc].reason = "test should have caused runtime error "; + + stopTest(); + + return ( testcases ); +} + + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[0] = new TestCase( "7.2", "<cr>a", "error", ""); + + return ( array ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.2-3-n.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.2-3-n.js new file mode 100644 index 0000000..ff3753d --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.2-3-n.js @@ -0,0 +1,83 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.2-3.js + ECMA Section: 7.2 Line Terminators + Description: - readability + - separate tokens + - may occur between any two tokens + - cannot occur within any token, not even a string + - affect the process of automatic semicolon insertion. + + white space characters are: + unicode name formal name string representation + \u000A line feed <LF> \n + \u000D carriage return <CR> \r + + this test uses onerror to capture line numbers. because + we use on error, we can only have one test case per file. + + Author: christine@netscape.com + Date: 11 september 1997 +*/ + var SECTION = "7.2-3"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Line Terminators"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function test() { + + // this is line 27 + + a = "\r\nb"; + eval( a ); + + // if we get this far, the test failed. + testcases[tc].passed = writeTestCaseResult( + "failure on line" + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ testcases[tc].actual ); + + testcases[0].passed = false; + + testcases[tc].reason = "test should have caused runtime error "; + + stopTest(); + return ( testcases ); +} + + + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[0] = new TestCase( "7.2", "<cr>a", "error", ""); + + return ( array ); +} + diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.2-4-n.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.2-4-n.js new file mode 100644 index 0000000..0f98b9b --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.2-4-n.js @@ -0,0 +1,82 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.2.js + ECMA Section: 7.2 Line Terminators + Description: - readability + - separate tokens + - may occur between any two tokens + - cannot occur within any token, not even a string + - affect the process of automatic semicolon insertion. + + white space characters are: + unicode name formal name string representation + \u000A line feed <LF> \n + \u000D carriage return <CR> \r + + this test uses onerror to capture line numbers. because + we use on error, we can only have one test case per file. + + Author: christine@netscape.com + Date: 11 september 1997 +*/ + var SECTION = "7.2-6"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Line Terminators"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function test() { + // this is line 33 + + a = "\nb"; + eval( a ); + + // if we get this far, the test failed. + testcases[tc].passed = writeTestCaseResult( + "failure on line" + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ testcases[tc].actual ); + + testcases[0].passed = false; + + testcases[tc].reason = "test should have caused runtime error "; + + stopTest(); + + return ( testcases ); +} + + + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[0] = new TestCase( "7.2", "a = \\nb", "error", ""); + + return ( array ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.2-5-n.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.2-5-n.js new file mode 100644 index 0000000..b226a98 --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.2-5-n.js @@ -0,0 +1,85 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.2.js + ECMA Section: 7.2 Line Terminators + Description: - readability + - separate tokens + - may occur between any two tokens + - cannot occur within any token, not even a string + - affect the process of automatic semicolon insertion. + + white space characters are: + unicode name formal name string representation + \u000A line feed <LF> \n + \u000D carriage return <CR> \r + + this test uses onerror to capture line numbers. because + we use on error, we can only have one test case per file. + + Author: christine@netscape.com + Date: 11 september 1997 +*/ + var SECTION = "7.2-5"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Line Terminators"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + + +function test() { + // this is line 27 + + a = "\rb"; + eval( a ); + + // if we get this far, the test failed. + testcases[tc].passed = writeTestCaseResult( + "failure on line" + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ testcases[tc].actual ); + + testcases[tc].passed = false; + + testcases[tc].reason = "test should have caused runtime error "; + + passed = false; + stopTest(); + + // all tests must return a boolean value + return ( testcases ); +} + + + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[0] = new TestCase( "7.2", "<cr>a", "error", ""); + + return ( array ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.2-6.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.2-6.js new file mode 100644 index 0000000..70cff7e --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.2-6.js @@ -0,0 +1,70 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.2-6.js + ECMA Section: 7.2 Line Terminators + Description: - readability + - separate tokens + - may occur between any two tokens + - cannot occur within any token, not even a string + - affect the process of automatic semicolon insertion. + + white space characters are: + unicode name formal name string representation + \u000A line feed <LF> \n + \u000D carriage return <CR> \r + + Author: christine@netscape.com + Date: 11 september 1997 +*/ + var SECTION = "7.2-6"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Line Terminators"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "var a\u000Ab = 5; ab=10;ab;", 10, eval("var a\nb = 5; ab=10;ab") ); + array[item++] = new TestCase( SECTION, "var a\u000Db = 5; ab=10;b;", 5, eval("var a\nb = 5; ab=10;b") ); + return ( array ); +} + +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.3-1.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.3-1.js new file mode 100644 index 0000000..ff94a3c --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.3-1.js @@ -0,0 +1,79 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.3-1.js + ECMA Section: 7.3 Comments + Description: + + + Author: christine@netscape.com + Date: 12 november 1997 + +*/ + var SECTION = "7.3-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Comments"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item] = new TestCase( SECTION, + "a comment with a line terminator string, and text following", + "pass", + "pass"); + + // "\u000A" array[item].actual = "fail"; + + item++; + + array[item] = new TestCase( SECTION, + "// test \\n array[item].actual = \"pass\"", + "pass", + "" ); + + var x = "// test \n array[item].actual = 'pass'" + + array[0].actual = eval(x); + + return ( array ); +} + +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +": "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : " ignored chars after line terminator of single-line comment"; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.3-10.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.3-10.js new file mode 100644 index 0000000..ed4a5b3 --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.3-10.js @@ -0,0 +1,67 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.3-10.js + ECMA Section: 7.3 Comments + Description: + + + Author: christine@netscape.com + Date: 12 november 1997 + +*/ + var SECTION = "7.3-10"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Comments"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, + "code following multiline comment", + "pass", + "fail"); + return ( array ); +} +function test() { + + /*//*/testcases[tc].actual="pass"; + + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +": "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : " ignored chars after line terminator of single-line comment"; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.3-11.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.3-11.js new file mode 100644 index 0000000..8b6773a --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.3-11.js @@ -0,0 +1,66 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.3-11.js + ECMA Section: 7.3 Comments + Description: + + + Author: christine@netscape.com + Date: 12 november 1997 + +*/ + var SECTION = "7.3-11"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Comments"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, + "code following multiline comment", + "pass", + "pass"); + return ( array ); +} +function test() { + + ////testcases[tc].actual="fail"; + + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +": "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : " ignored chars after line terminator of single-line comment"; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.3-12.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.3-12.js new file mode 100644 index 0000000..fede098 --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.3-12.js @@ -0,0 +1,66 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.3-12.js + ECMA Section: 7.3 Comments + Description: + + + Author: christine@netscape.com + Date: 12 november 1997 + +*/ + var SECTION = "7.3-12"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Comments"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, + "code following multiline comment", + "pass", + "pass"); + return ( array ); +} +function test() { + + /*testcases[tc].actual="fail";**/ + + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +": "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : " ignored chars after line terminator of single-line comment"; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.3-13-n.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.3-13-n.js new file mode 100644 index 0000000..92394e6 --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.3-13-n.js @@ -0,0 +1,66 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.3-13-n.js + ECMA Section: 7.3 Comments + Description: + + + Author: christine@netscape.com + Date: 12 november 1997 + +*/ + var SECTION = "7.3-13-n"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Comments"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, + "nested comment", + "error", + "pass"); + return ( array ); +} +function test() { + + /*/*testcases[tc].actual="fail";*/*/ + + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +": "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : " ignored chars after line terminator of single-line comment"; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.3-2.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.3-2.js new file mode 100644 index 0000000..8eca512 --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.3-2.js @@ -0,0 +1,67 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.3-2.js + ECMA Section: 7.3 Comments + Description: + + + Author: christine@netscape.com + Date: 12 november 1997 + +*/ + var SECTION = "7.3-2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Comments"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, + "a comment with a carriage return, and text following", + "pass", + "pass"); + return ( array ); +} +function test() { + + // "\u000D" testcases[tc].actual = "fail"; + + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +": "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : " ignored chars after line terminator of single-line comment"; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.3-3.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.3-3.js new file mode 100644 index 0000000..1bcd561 --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.3-3.js @@ -0,0 +1,67 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.3-3.js + ECMA Section: 7.3 Comments + Description: + + + Author: christine@netscape.com + Date: 12 november 1997 + +*/ + var SECTION = "7.3-3"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Comments"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, + "source text directly following a single-line comment", + "pass", + "fail"); + return ( array ); +} +function test() { + + // a comment string + testcases[tc].actual = "pass"; + + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +": "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : " ignored chars after line terminator of single-line comment"; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.3-4.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.3-4.js new file mode 100644 index 0000000..7ac82c7 --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.3-4.js @@ -0,0 +1,67 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.3-4.js + ECMA Section: 7.3 Comments + Description: + + + Author: christine@netscape.com + Date: 12 november 1997 + +*/ + var SECTION = "7.3-4"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Comments"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, + "multiline comment ", + "pass", + "pass"); + return ( array ); +} +function test() { + + /*testcases[tc].actual = "fail";*/ + + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +": "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : " ignored chars after line terminator of single-line comment"; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.3-5.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.3-5.js new file mode 100644 index 0000000..2ce6844 --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.3-5.js @@ -0,0 +1,66 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.3-5.js + ECMA Section: 7.3 Comments + Description: + + + Author: christine@netscape.com + Date: 12 november 1997 + +*/ + var SECTION = "7.3-5"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Comments"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, + "a comment with a carriage return, and text following", + "pass", + "pass"); + return ( array ); +} +function test() { + + // "\u000A" testcases[tc].actual = "fail"; + + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +": "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : " ignored chars after line terminator of single-line comment"; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.3-6.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.3-6.js new file mode 100644 index 0000000..d010817 --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.3-6.js @@ -0,0 +1,68 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.3-6.js + ECMA Section: 7.3 Comments + Description: + + + Author: christine@netscape.com + Date: 12 november 1997 + +*/ + var SECTION = "7.3-6"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Comments"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, + "comment with multiple asterisks", + "pass", + "fail"); + return ( array ); +} +function test() { + + /* + ***/testcases[tc].actual="pass"; + + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +": "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : " ignored chars after line terminator of single-line comment"; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.3-7.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.3-7.js new file mode 100644 index 0000000..8bdf623 --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.3-7.js @@ -0,0 +1,68 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.3-7.js + ECMA Section: 7.3 Comments + Description: + + + Author: christine@netscape.com + Date: 12 november 1997 + +*/ + var SECTION = "7.3-7"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Comments"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, + "single line comment following multiline comment", + "pass", + "pass"); + return ( array ); +} +function test() { + + /* + ***///testcases[tc].actual="fail"; + + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +": "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : " ignored chars after line terminator of single-line comment"; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.3-8.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.3-8.js new file mode 100644 index 0000000..6d686cf --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.3-8.js @@ -0,0 +1,67 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.3-7.js + ECMA Section: 7.3 Comments + Description: + + + Author: christine@netscape.com + Date: 12 november 1997 + +*/ + var SECTION = "7.3-8"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Comments"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, + "code following multiline comment", + "pass", + "fail"); + return ( array ); +} +function test() { + + /**/testcases[tc].actual="pass"; + + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +": "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : " ignored chars after line terminator of single-line comment"; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.3-9.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.3-9.js new file mode 100644 index 0000000..701e115 --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.3-9.js @@ -0,0 +1,66 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.3-9.js + ECMA Section: 7.3 Comments + Description: + + + Author: christine@netscape.com + Date: 12 november 1997 + +*/ + var SECTION = "7.3-9"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Comments"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, + "code following multiline comment", + "pass", + "fail"); + return ( array ); +} +function test() { + + /*/*/testcases[tc].actual="pass"; + + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +": "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : " ignored chars after line terminator of single-line comment"; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.1-1-n.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.1-1-n.js new file mode 100644 index 0000000..37b1c4e --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.1-1-n.js @@ -0,0 +1,71 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.4.1-1-n.js + ECMA Section: 7.4.1 + + Description: + + Reserved words cannot be used as identifiers. + + ReservedWord :: + Keyword + FutureReservedWord + NullLiteral + BooleanLiteral + + Author: christine@netscape.com + Date: 12 november 1997 + +*/ + var SECTION = "7.4.1-1-n"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Keywords"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, "var null = true", "error", "var null = true" ); + return ( array ); +} + +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].actual = eval( testcases[tc].actual ); + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.1-2-n.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.1-2-n.js new file mode 100644 index 0000000..f85891b --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.1-2-n.js @@ -0,0 +1,70 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.4.1-2.js + ECMA Section: 7.4.1 + + Description: + + Reserved words cannot be used as identifiers. + + ReservedWord :: + Keyword + FutureReservedWord + NullLiteral + BooleanLiteral + + Author: christine@netscape.com + Date: 12 november 1997 + +*/ + var SECTION = "7.4.1-2-n"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Keywords"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, "var true = false", "error", "var true = false" ); + return ( array ); +} + +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].actual = eval( testcases[tc].actual ); + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.1-3-n.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.1-3-n.js new file mode 100644 index 0000000..a05480a --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.1-3-n.js @@ -0,0 +1,70 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.4.1-3-n.js + ECMA Section: 7.4.1 + + Description: + + Reserved words cannot be used as identifiers. + + ReservedWord :: + Keyword + FutureReservedWord + NullLiteral + BooleanLiteral + + Author: christine@netscape.com + Date: 12 november 1997 + +*/ + var SECTION = "7.4.1-3-n"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Keywords"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, "var false = true", "error", "var false = true" ); + return ( array ); +} + +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].actual = eval( testcases[tc].actual ); + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.2-1-n.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.2-1-n.js new file mode 100644 index 0000000..43d0425 --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.2-1-n.js @@ -0,0 +1,76 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.4.2-1.js + ECMA Section: 7.4.2 + + Description: + The following tokens are ECMAScript keywords and may not be used as + identifiers in ECMAScript programs. + + Syntax + + Keyword :: one of + break for new var + continue function return void + delete if this while + else in typeof with + + This test verifies that the keyword cannot be used as an identifier. + Functioinal tests of the keyword may be found in the section corresponding + to the function of the keyword. + + Author: christine@netscape.com + Date: 12 november 1997 + +*/ + var SECTION = "7.4.2-1-n"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Keywords"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, "var break = true", "error", "var break = true" ); + return ( array ); +} + +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].actual = eval( testcases[tc].actual ); + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.2-10-n.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.2-10-n.js new file mode 100644 index 0000000..0ad19db --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.2-10-n.js @@ -0,0 +1,76 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.4.2-10.js + ECMA Section: 7.4.2 + + Description: + The following tokens are ECMAScript keywords and may not be used as + identifiers in ECMAScript programs. + + Syntax + + Keyword :: one of + break for new var + continue function return void + delete if this while + else in typeof with + + This test verifies that the keyword cannot be used as an identifier. + Functioinal tests of the keyword may be found in the section corresponding + to the function of the keyword. + + Author: christine@netscape.com + Date: 12 november 1997 + +*/ + var SECTION = "7.4.1-10-n"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Keywords"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, "var if = true", "error", "var if = true" ); + return ( array ); +} + +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].actual = eval( testcases[tc].actual ); + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.2-11-n.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.2-11-n.js new file mode 100644 index 0000000..e8a0f80 --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.2-11-n.js @@ -0,0 +1,76 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.4.2-11-n.js + ECMA Section: 7.4.2 + + Description: + The following tokens are ECMAScript keywords and may not be used as + identifiers in ECMAScript programs. + + Syntax + + Keyword :: one of + break for new var + continue function return void + delete if this while + else in typeof with + + This test verifies that the keyword cannot be used as an identifier. + Functioinal tests of the keyword may be found in the section corresponding + to the function of the keyword. + + Author: christine@netscape.com + Date: 12 november 1997 + +*/ + var SECTION = "7.4.1-11-n"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Keywords"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, "var this = true", "error", "var this = true" ); + return ( array ); +} + +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].actual = eval( testcases[tc].actual ); + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.2-12-n.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.2-12-n.js new file mode 100644 index 0000000..ffc3350 --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.2-12-n.js @@ -0,0 +1,77 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.4.2-12-n.js + ECMA Section: 7.4.2 + + Description: + The following tokens are ECMAScript keywords and may not be used as + identifiers in ECMAScript programs. + + Syntax + + Keyword :: one of + break for new var + continue function return void + delete if this while + else in typeof with + + This test verifies that the keyword cannot be used as an identifier. + Functioinal tests of the keyword may be found in the section corresponding + to the function of the keyword. + + Author: christine@netscape.com + Date: 12 november 1997 + +*/ + var SECTION = "7.4.1-12-n"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Keywords"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, "var while = true", "error", "var while = true" ); + return ( array ); +} + +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].actual = eval( testcases[tc].actual ); + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.2-13-n.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.2-13-n.js new file mode 100644 index 0000000..78320b2 --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.2-13-n.js @@ -0,0 +1,76 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.4.2-13-n.js + ECMA Section: 7.4.2 + + Description: + The following tokens are ECMAScript keywords and may not be used as + identifiers in ECMAScript programs. + + Syntax + + Keyword :: one of + break for new var + continue function return void + delete if this while + else in typeof with + + This test verifies that the keyword cannot be used as an identifier. + Functioinal tests of the keyword may be found in the section corresponding + to the function of the keyword. + + Author: christine@netscape.com + Date: 12 november 1997 + +*/ + var SECTION = "7.4.1-13-n"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Keywords"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, "var else = true", "error", "var else = true" ); + return ( array ); +} + +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].actual = eval( testcases[tc].actual ); + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.2-14-n.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.2-14-n.js new file mode 100644 index 0000000..4b8bb0f --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.2-14-n.js @@ -0,0 +1,76 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.4.2-14-n.js + ECMA Section: 7.4.2 + + Description: + The following tokens are ECMAScript keywords and may not be used as + identifiers in ECMAScript programs. + + Syntax + + Keyword :: one of + break for new var + continue function return void + delete if this while + else in typeof with + + This test verifies that the keyword cannot be used as an identifier. + Functioinal tests of the keyword may be found in the section corresponding + to the function of the keyword. + + Author: christine@netscape.com + Date: 12 november 1997 + +*/ + var SECTION = "7.4.1-14-n"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Keywords"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, "var in = true", "error", "var in = true" ); + return ( array ); +} + +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].actual = eval( testcases[tc].actual ); + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.2-15-n.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.2-15-n.js new file mode 100644 index 0000000..d84f9d7 --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.2-15-n.js @@ -0,0 +1,77 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.4.2-15-n.js + ECMA Section: 7.4.2 + + Description: + The following tokens are ECMAScript keywords and may not be used as + identifiers in ECMAScript programs. + + Syntax + + Keyword :: one of + break for new var + continue function return void + delete if this while + else in typeof with + + This test verifies that the keyword cannot be used as an identifier. + Functioinal tests of the keyword may be found in the section corresponding + to the function of the keyword. + + Author: christine@netscape.com + Date: 12 november 1997 + +*/ + var SECTION = "7.4.1-15-n"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Keywords"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, "var typeof = true", "error", "var typeof = true" ); + return ( array ); +} + +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].actual = eval( testcases[tc].actual ); + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.2-16-n.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.2-16-n.js new file mode 100644 index 0000000..8293eee --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.2-16-n.js @@ -0,0 +1,76 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.4.2-16-n.js + ECMA Section: 7.4.2 + + Description: + The following tokens are ECMAScript keywords and may not be used as + identifiers in ECMAScript programs. + + Syntax + + Keyword :: one of + break for new var + continue function return void + delete if this while + else in typeof with + + This test verifies that the keyword cannot be used as an identifier. + Functioinal tests of the keyword may be found in the section corresponding + to the function of the keyword. + + Author: christine@netscape.com + Date: 12 november 1997 + +*/ + var SECTION = "7.4.1-16-n"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Keywords"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, "var with = true", "error", "var with = true" ); + return ( array ); +} + +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].actual = eval( testcases[tc].actual ); + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.2-2-n.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.2-2-n.js new file mode 100644 index 0000000..2b799b1 --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.2-2-n.js @@ -0,0 +1,75 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.4.2-2-n.js + ECMA Section: 7.4.2 + + Description: + The following tokens are ECMAScript keywords and may not be used as + identifiers in ECMAScript programs. + + Syntax + + Keyword :: one of + break for new var + continue function return void + delete if this while + else in typeof with + + This test verifies that the keyword cannot be used as an identifier. + Functioinal tests of the keyword may be found in the section corresponding + to the function of the keyword. + + Author: christine@netscape.com + Date: 12 november 1997 + +*/ + var SECTION = "7.4.1-2-n"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Keywords"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, "var for = true", "error", "var for = true" ); + return ( array ); +} + +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].actual = eval( testcases[tc].actual ); + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.2-3-n.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.2-3-n.js new file mode 100644 index 0000000..3b5feb0 --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.2-3-n.js @@ -0,0 +1,75 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.4.2-3-n.js + ECMA Section: 7.4.2 + + Description: + The following tokens are ECMAScript keywords and may not be used as + identifiers in ECMAScript programs. + + Syntax + + Keyword :: one of + break for new var + continue function return void + delete if this while + else in typeof with + + This test verifies that the keyword cannot be used as an identifier. + Functioinal tests of the keyword may be found in the section corresponding + to the function of the keyword. + + Author: christine@netscape.com + Date: 12 november 1997 + +*/ + var SECTION = "7.4.2-3-n"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Keywords"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, "var new = true", "error", "var new = true" ); + return ( array ); +} + +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].actual = eval( testcases[tc].actual ); + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.2-4-n.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.2-4-n.js new file mode 100644 index 0000000..13faf32 --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.2-4-n.js @@ -0,0 +1,76 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.4.2-4-n.js + ECMA Section: 7.4.2 + + Description: + The following tokens are ECMAScript keywords and may not be used as + identifiers in ECMAScript programs. + + Syntax + + Keyword :: one of + break for new var + continue function return void + delete if this while + else in typeof with + + This test verifies that the keyword cannot be used as an identifier. + Functioinal tests of the keyword may be found in the section corresponding + to the function of the keyword. + + Author: christine@netscape.com + Date: 12 november 1997 + +*/ + var SECTION = "7.4.2-4-n"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Keywords"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, "var var = true", "error", "var var = true" ); + return ( array ); +} + +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].actual = eval( testcases[tc].actual ); + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.2-5-n.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.2-5-n.js new file mode 100644 index 0000000..004249b --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.2-5-n.js @@ -0,0 +1,76 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.4.2-5-n.js + ECMA Section: 7.4.2 + + Description: + The following tokens are ECMAScript keywords and may not be used as + identifiers in ECMAScript programs. + + Syntax + + Keyword :: one of + break for new var + continue function return void + delete if this while + else in typeof with + + This test verifies that the keyword cannot be used as an identifier. + Functioinal tests of the keyword may be found in the section corresponding + to the function of the keyword. + + Author: christine@netscape.com + Date: 12 november 1997 + +*/ + var SECTION = "7.4.2-5-n"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Keywords"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, "var continue = true", "error", "var continue = true" ); + return ( array ); +} + +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].actual = eval( testcases[tc].actual ); + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.2-6-n.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.2-6-n.js new file mode 100644 index 0000000..3b830f8 --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.2-6-n.js @@ -0,0 +1,76 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.4.2-6.js + ECMA Section: 7.4.2 + + Description: + The following tokens are ECMAScript keywords and may not be used as + identifiers in ECMAScript programs. + + Syntax + + Keyword :: one of + break for new var + continue function return void + delete if this while + else in typeof with + + This test verifies that the keyword cannot be used as an identifier. + Functioinal tests of the keyword may be found in the section corresponding + to the function of the keyword. + + Author: christine@netscape.com + Date: 12 november 1997 + +*/ + var SECTION = "7.4.2-6-n"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Keywords"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, "var function = true", "error", "var function = true" ); + return ( array ); +} + +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].actual = eval( testcases[tc].actual ); + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.2-7-n.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.2-7-n.js new file mode 100644 index 0000000..c84ca9d --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.2-7-n.js @@ -0,0 +1,73 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.4.2-7-n.js + ECMA Section: 7.4.2 + + Description: + The following tokens are ECMAScript keywords and may not be used as + identifiers in ECMAScript programs. + + Syntax + + Keyword :: one of + break for new var + continue function return void + delete if this while + else in typeof with + + This test verifies that the keyword cannot be used as an identifier. + Functioinal tests of the keyword may be found in the section corresponding + to the function of the keyword. + + Author: christine@netscape.com + Date: 12 november 1997 + +*/ + var SECTION = "7.4.2-7"; + var VERSION = "ECMA_1"; + startTest(); + var testcases = getTestCases(); + writeHeaderToLog( SECTION + " Keywords"); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, "var return = true", "error", "var return = true" ); + return ( array ); +} + +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].actual = eval( testcases[tc].actual ); + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.2-8-n.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.2-8-n.js new file mode 100644 index 0000000..f2397bb --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.2-8-n.js @@ -0,0 +1,73 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.4.2-8-n.js + ECMA Section: 7.4.2 + + Description: + The following tokens are ECMAScript keywords and may not be used as + identifiers in ECMAScript programs. + + Syntax + + Keyword :: one of + break for new var + continue function return void + delete if this while + else in typeof with + + This test verifies that the keyword cannot be used as an identifier. + Functioinal tests of the keyword may be found in the section corresponding + to the function of the keyword. + + Author: christine@netscape.com + Date: 12 november 1997 + +*/ + var SECTION = "7.4.2-8"; + var VERSION = "ECMA_1"; + startTest(); + var testcases = getTestCases(); + writeHeaderToLog( SECTION + " Keywords"); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, "var void = true", "error", "var void = true" ); + return ( array ); +} + +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].actual = eval( testcases[tc].actual ); + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.2-9-n.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.2-9-n.js new file mode 100644 index 0000000..5b5a288 --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.2-9-n.js @@ -0,0 +1,76 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.4.2-9-n.js + ECMA Section: 7.4.2 + + Description: + The following tokens are ECMAScript keywords and may not be used as + identifiers in ECMAScript programs. + + Syntax + + Keyword :: one of + break for new var + continue function return void + delete if this while + else in typeof with + + This test verifies that the keyword cannot be used as an identifier. + Functioinal tests of the keyword may be found in the section corresponding + to the function of the keyword. + + Author: christine@netscape.com + Date: 12 november 1997 + +*/ + var SECTION = "7.4.1-9-n"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Keywords"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, "var delete = true", "error", "var delete = true" ); + return ( array ); +} + +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].actual = eval( testcases[tc].actual ); + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.3-1-n.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.3-1-n.js new file mode 100644 index 0000000..5a626a4 --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.3-1-n.js @@ -0,0 +1,71 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.4.3-1-n.js + ECMA Section: 7.4.3 + + Description: + The following words are used as keywords in proposed extensions and are + therefore reserved to allow for the possibility of future adoption of + those extensions. + + FutureReservedWord :: one of + case debugger export super + catch default extends switch + class do finally throw + const enum import try + + Author: christine@netscape.com + Date: 12 november 1997 +*/ + var SECTION = "7.4.3-1-n"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Future Reserved Words"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, "var case = true", "error", "var case = true" ); + return ( array ); +} + +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].actual = eval( testcases[tc].actual ); + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.3-10-n.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.3-10-n.js new file mode 100644 index 0000000..84d6cf3 --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.3-10-n.js @@ -0,0 +1,71 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.4.3-10-n.js + ECMA Section: 7.4.3 + + Description: + The following words are used as keywords in proposed extensions and are + therefore reserved to allow for the possibility of future adoption of + those extensions. + + FutureReservedWord :: one of + case debugger export super + catch default extends switch + class do finally throw + const enum import try + + Author: christine@netscape.com + Date: 12 november 1997 +*/ + var SECTION = "7.4.3-10-n"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Future Reserved Words"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, "var do = true", "error", "var do = true" ); + return ( array ); +} + +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].actual = eval( testcases[tc].actual ); + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.3-11-n.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.3-11-n.js new file mode 100644 index 0000000..b850584 --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.3-11-n.js @@ -0,0 +1,70 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.4.3-11-n.js + ECMA Section: 7.4.3 + + Description: + The following words are used as keywords in proposed extensions and are + therefore reserved to allow for the possibility of future adoption of + those extensions. + + FutureReservedWord :: one of + case debugger export super + catch default extends switch + class do finally throw + const enum import try + + Author: christine@netscape.com + Date: 12 november 1997 +*/ + var SECTION = "7.4.3-11-n"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Future Reserved Words"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, "var finally = true", "error", "var finally = true" ); + return ( array ); +} + +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].actual = eval( testcases[tc].actual ); + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.3-12-n.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.3-12-n.js new file mode 100644 index 0000000..7dfe3cc --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.3-12-n.js @@ -0,0 +1,72 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.4.3-12-n.js + ECMA Section: 7.4.3 + + Description: + The following words are used as keywords in proposed extensions and are + therefore reserved to allow for the possibility of future adoption of + those extensions. + + FutureReservedWord :: one of + case debugger export super + catch default extends switch + class do finally throw + const enum import try + + Author: christine@netscape.com + Date: 12 november 1997 +*/ + var SECTION = "7.4.3-12-n"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Future Reserved Words"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + + + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, "var throw = true", "error", "var throw = true" ); + return ( array ); +} + +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].actual = eval( testcases[tc].actual ); + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.3-13-n.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.3-13-n.js new file mode 100644 index 0000000..ede44c1 --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.3-13-n.js @@ -0,0 +1,72 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.4.3-13-n.js + ECMA Section: 7.4.3 + + Description: + The following words are used as keywords in proposed extensions and are + therefore reserved to allow for the possibility of future adoption of + those extensions. + + FutureReservedWord :: one of + case debugger export super + catch default extends switch + class do finally throw + const enum import try + + Author: christine@netscape.com + Date: 12 november 1997 +*/ + var SECTION = "7.4.3-13-n"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Future Reserved Words"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + + + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, "var const = true", "error", "var const = true" ); + return ( array ); +} + +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].actual = eval( testcases[tc].actual ); + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.3-14-n.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.3-14-n.js new file mode 100644 index 0000000..31b6794 --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.3-14-n.js @@ -0,0 +1,70 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.4.3-14-n.js + ECMA Section: 7.4.3 + + Description: + The following words are used as keywords in proposed extensions and are + therefore reserved to allow for the possibility of future adoption of + those extensions. + + FutureReservedWord :: one of + case debugger export super + catch default extends switch + class do finally throw + const enum import try + + Author: christine@netscape.com + Date: 12 november 1997 +*/ + var SECTION = "7.4.3-14-n"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Future Reserved Words"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, "var enum = true", "error", "var enum = true" ); + return ( array ); +} + +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].actual = eval( testcases[tc].actual ); + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.3-15-n.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.3-15-n.js new file mode 100644 index 0000000..dfda054 --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.3-15-n.js @@ -0,0 +1,72 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.4.3-15-n.js + ECMA Section: 7.4.3 + + Description: + The following words are used as keywords in proposed extensions and are + therefore reserved to allow for the possibility of future adoption of + those extensions. + + FutureReservedWord :: one of + case debugger export super + catch default extends switch + class do finally throw + const enum import try + + Author: christine@netscape.com + Date: 12 november 1997 +*/ + var SECTION = "7.4.3-15-n"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Future Reserved Words"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + + + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, "var import = true", "error", "var import = true" ); + return ( array ); +} + +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].actual = eval( testcases[tc].actual ); + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.3-16-n.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.3-16-n.js new file mode 100644 index 0000000..cf61635 --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.3-16-n.js @@ -0,0 +1,69 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: lexical-023.js + Corresponds To: 7.4.3-16-n.js + ECMA Section: 7.4.3 + Description: + The following words are used as keywords in proposed extensions and are + therefore reserved to allow for the possibility of future adoption of + those extensions. + + FutureReservedWord :: one of + case debugger export super + catch default extends switch + class do finally throw + const enum import try + + Author: christine@netscape.com + Date: 12 november 1997 +*/ + var SECTION = "lexical-023.js"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Future Reserved Words"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = new Array(); + + var result = "Failed"; + var exception = "No exception thrown"; + var expect = "Passed"; + + try { + try = true; + } catch ( e ) { + result = expect; + exception = e.toString(); + } + + testcases[tc++] = new TestCase( + SECTION, + "try = true" + + " (threw " + exception +")", + expect, + result ); + + test(); + + diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.3-2-n.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.3-2-n.js new file mode 100644 index 0000000..46da571 --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.3-2-n.js @@ -0,0 +1,72 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.4.3-2-n.js + ECMA Section: 7.4.3 + + Description: + The following words are used as keywords in proposed extensions and are + therefore reserved to allow for the possibility of future adoption of + those extensions. + + FutureReservedWord :: one of + case debugger export super + catch default extends switch + class do finally throw + const enum import try + + Author: christine@netscape.com + Date: 12 november 1997 +*/ + var SECTION = "7.4.3-2-n"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Future Reserved Words"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + + + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, "var debugger = true", "error", "var debugger = true" ); + return ( array ); +} + +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].actual = eval( testcases[tc].actual ); + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.3-3-n.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.3-3-n.js new file mode 100644 index 0000000..bfdbe3b --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.3-3-n.js @@ -0,0 +1,72 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.4.3-3-n.js + ECMA Section: 7.4.3 + + Description: + The following words are used as keywords in proposed extensions and are + therefore reserved to allow for the possibility of future adoption of + those extensions. + + FutureReservedWord :: one of + case debugger export super + catch default extends switch + class do finally throw + const enum import try + + Author: christine@netscape.com + Date: 12 november 1997 +*/ + var SECTION = "7.4.3-3-n"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Future Reserved Words"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + + + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, "var export = true", "error", "var export = true" ); + return ( array ); +} + +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].actual = eval( testcases[tc].actual ); + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.3-4-n.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.3-4-n.js new file mode 100644 index 0000000..11b97c9 --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.3-4-n.js @@ -0,0 +1,72 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.4.3-4-n.js + ECMA Section: 7.4.3 + + Description: + The following words are used as keywords in proposed extensions and are + therefore reserved to allow for the possibility of future adoption of + those extensions. + + FutureReservedWord :: one of + case debugger export super + catch default extends switch + class do finally throw + const enum import try + + Author: christine@netscape.com + Date: 12 november 1997 +*/ + var SECTION = "7.4.3-4-n"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Future Reserved Words"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + + + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, "var super = true", "error", "var super = true" ); + return ( array ); +} + +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].actual = eval( testcases[tc].actual ); + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.3-5-n.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.3-5-n.js new file mode 100644 index 0000000..8acbbcd --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.3-5-n.js @@ -0,0 +1,70 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.4.3-5-n.js + ECMA Section: 7.4.3 + + Description: + The following words are used as keywords in proposed extensions and are + therefore reserved to allow for the possibility of future adoption of + those extensions. + + FutureReservedWord :: one of + case debugger export super + catch default extends switch + class do finally throw + const enum import try + + Author: christine@netscape.com + Date: 12 november 1997 +*/ + var SECTION = "7.4.3-5-n"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Future Reserved Words"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, "var catch = true", "error", "var catch = true" ); + return ( array ); +} + +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].actual = eval( testcases[tc].actual ); + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.3-6-n.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.3-6-n.js new file mode 100644 index 0000000..d5ea75e --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.3-6-n.js @@ -0,0 +1,70 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.4.3-6-n.js + ECMA Section: 7.4.3 + + Description: + The following words are used as keywords in proposed extensions and are + therefore reserved to allow for the possibility of future adoption of + those extensions. + + FutureReservedWord :: one of + case debugger export super + catch default extends switch + class do finally throw + const enum import try + + Author: christine@netscape.com + Date: 12 november 1997 +*/ + var SECTION = "7.4.3-6-n"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Future Reserved Words"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, "var default = true", "error", "var default = true" ); + return ( array ); +} + +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].actual = eval( testcases[tc].actual ); + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.3-7-n.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.3-7-n.js new file mode 100644 index 0000000..93cf4cd --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.3-7-n.js @@ -0,0 +1,70 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.4.3-7-n.js + ECMA Section: 7.4.3 + + Description: + The following words are used as keywords in proposed extensions and are + therefore reserved to allow for the possibility of future adoption of + those extensions. + + FutureReservedWord :: one of + case debugger export super + catch default extends switch + class do finally throw + const enum import try + + Author: christine@netscape.com + Date: 12 november 1997 +*/ + var SECTION = "7.4.3-7-n"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Future Reserved Words"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, "var extends = true", "error", "var extends = true" ); + return ( array ); +} + +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].actual = eval( testcases[tc].actual ); + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.3-8-n.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.3-8-n.js new file mode 100644 index 0000000..7d09f0c --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.3-8-n.js @@ -0,0 +1,70 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.4.3-8-n.js + ECMA Section: 7.4.3 + + Description: + The following words are used as keywords in proposed extensions and are + therefore reserved to allow for the possibility of future adoption of + those extensions. + + FutureReservedWord :: one of + case debugger export super + catch default extends switch + class do finally throw + const enum import try + + Author: christine@netscape.com + Date: 12 november 1997 +*/ + var SECTION = "7.4.3-9-n"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Future Reserved Words"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, "var switch = true", "error", "var switch = true" ); + return ( array ); +} + +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].actual = eval( testcases[tc].actual ); + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.3-9-n.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.3-9-n.js new file mode 100644 index 0000000..f0e71f9 --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.4.3-9-n.js @@ -0,0 +1,70 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.4.3-9-n.js + ECMA Section: 7.4.3 + + Description: + The following words are used as keywords in proposed extensions and are + therefore reserved to allow for the possibility of future adoption of + those extensions. + + FutureReservedWord :: one of + case debugger export super + catch default extends switch + class do finally throw + const enum import try + + Author: christine@netscape.com + Date: 12 november 1997 +*/ + var SECTION = "7.4.3-9-n"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Future Reserved Words"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + array[item++] = new TestCase( SECTION, "var class = true", "error", "var class = true" ); + return ( array ); +} + +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].actual = eval( testcases[tc].actual ); + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.5-1.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.5-1.js new file mode 100644 index 0000000..ef1b257 --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.5-1.js @@ -0,0 +1,65 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.5-1.js + ECMA Section: 7.5 Identifiers + Description: Identifiers are of unlimited length + - can contain letters, a decimal digit, _, or $ + - the first character cannot be a decimal digit + - identifiers are case sensitive + + Author: christine@netscape.com + Date: 11 september 1997 +*/ + var SECTION = "7.5-1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Identifiers"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "var $123 = 5", 5, eval("var $123 = 5;$123") ); + array[item++] = new TestCase( SECTION, "var _123 = 5", 5, eval("var _123 = 5;_123") ); + + return ( array ); +} + +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +": "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : " ignored chars after line terminator of single-line comment"; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.5-10-n.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.5-10-n.js new file mode 100644 index 0000000..b1bb872 --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.5-10-n.js @@ -0,0 +1,70 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.5-9-n.js + ECMA Section: 7.5 Identifiers + Description: Identifiers are of unlimited length + - can contain letters, a decimal digit, _, or $ + - the first character cannot be a decimal digit + - identifiers are case sensitive + + Author: christine@netscape.com + Date: 11 september 1997 +*/ + var SECTION = "7.5-9-n"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Identifiers"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item] = new TestCase( SECTION, "var 123=\"hi\"", "error", "" ); + + 123 = "hi"; + + array[item] = 123; + + return ( array ); +} + +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].actual = eval( testcases[tc].actual ); + + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +": "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : " ignored chars after line terminator of single-line comment"; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.5-2-n.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.5-2-n.js new file mode 100644 index 0000000..b8a161d --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.5-2-n.js @@ -0,0 +1,65 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.5-2-n.js + ECMA Section: 7.5 Identifiers + Description: Identifiers are of unlimited length + - can contain letters, a decimal digit, _, or $ + - the first character cannot be a decimal digit + - identifiers are case sensitive + + Author: christine@netscape.com + Date: 11 september 1997 +*/ + var SECTION = "7.5-2-n"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Identifiers"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "var 0abc", "error", "var 0abc" ); + return ( array ); +} + +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].actual = eval( testcases[tc].actual ); + + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +": "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : " ignored chars after line terminator of single-line comment"; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.5-3-n.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.5-3-n.js new file mode 100644 index 0000000..0d0aa84 --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.5-3-n.js @@ -0,0 +1,65 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.5-2.js + ECMA Section: 7.5 Identifiers + Description: Identifiers are of unlimited length + - can contain letters, a decimal digit, _, or $ + - the first character cannot be a decimal digit + - identifiers are case sensitive + + Author: christine@netscape.com + Date: 11 september 1997 +*/ + var SECTION = "7.5-3-n"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Identifiers"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "var 0abc", "error", "var 1abc" ); + return ( array ); +} + +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].actual = eval( testcases[tc].actual ); + + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +": "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : " ignored chars after line terminator of single-line comment"; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.5-4-n.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.5-4-n.js new file mode 100644 index 0000000..8a21a77 --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.5-4-n.js @@ -0,0 +1,65 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.5-4-n.js + ECMA Section: 7.5 Identifiers + Description: Identifiers are of unlimited length + - can contain letters, a decimal digit, _, or $ + - the first character cannot be a decimal digit + - identifiers are case sensitive + + Author: christine@netscape.com + Date: 11 september 1997 +*/ + var SECTION = "7.5-4-n"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Identifiers"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "var 0abc", "error", "var 2abc" ); + return ( array ); +} + +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].actual = eval( testcases[tc].actual ); + + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +": "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : " ignored chars after line terminator of single-line comment"; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.5-5-n.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.5-5-n.js new file mode 100644 index 0000000..7a17f16 --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.5-5-n.js @@ -0,0 +1,65 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.5-5-n.js + ECMA Section: 7.5 Identifiers + Description: Identifiers are of unlimited length + - can contain letters, a decimal digit, _, or $ + - the first character cannot be a decimal digit + - identifiers are case sensitive + + Author: christine@netscape.com + Date: 11 september 1997 +*/ + var SECTION = "7.5-5-n"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Identifiers"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "var 0abc", "error", "var 3abc" ); + return ( array ); +} + +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].actual = eval( testcases[tc].actual ); + + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +": "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : " ignored chars after line terminator of single-line comment"; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.5-6.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.5-6.js new file mode 100644 index 0000000..8b19307 --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.5-6.js @@ -0,0 +1,65 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.5-6.js + ECMA Section: 7.5 Identifiers + Description: Identifiers are of unlimited length + - can contain letters, a decimal digit, _, or $ + - the first character cannot be a decimal digit + - identifiers are case sensitive + + Author: christine@netscape.com + Date: 11 september 1997 +*/ + var SECTION = "7.5-6"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Identifiers"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "var _0abc = 5", 5, "var _0abc = 5; _0abc" ); + return ( array ); +} + +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].actual = eval( testcases[tc].actual ); + + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +": "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : " ignored chars after line terminator of single-line comment"; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.5-7.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.5-7.js new file mode 100644 index 0000000..7ade939 --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.5-7.js @@ -0,0 +1,65 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.5-7.js + ECMA Section: 7.5 Identifiers + Description: Identifiers are of unlimited length + - can contain letters, a decimal digit, _, or $ + - the first character cannot be a decimal digit + - identifiers are case sensitive + + Author: christine@netscape.com + Date: 11 september 1997 +*/ + var SECTION = "7.5-7"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Identifiers"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "var $0abc = 5", 5, "var $0abc = 5; $0abc" ); + return ( array ); +} + +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].actual = eval( testcases[tc].actual ); + + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +": "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : " ignored chars after line terminator of single-line comment"; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.5-8-n.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.5-8-n.js new file mode 100644 index 0000000..f17e071 --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.5-8-n.js @@ -0,0 +1,65 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.5-8-n.js + ECMA Section: 7.5 Identifiers + Description: Identifiers are of unlimited length + - can contain letters, a decimal digit, _, or $ + - the first character cannot be a decimal digit + - identifiers are case sensitive + + Author: christine@netscape.com + Date: 11 september 1997 +*/ + var SECTION = "7.5-8-n"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Identifiers"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "var @0abc = 5", "error", "var @0abc = 5; @0abc" ); + return ( array ); +} + +function test() {s + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].actual = eval( testcases[tc].actual ); + + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +": "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : " ignored chars after line terminator of single-line comment"; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.5-9-n.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.5-9-n.js new file mode 100644 index 0000000..8ef78d6 --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.5-9-n.js @@ -0,0 +1,70 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.5-9-n.js + ECMA Section: 7.5 Identifiers + Description: Identifiers are of unlimited length + - can contain letters, a decimal digit, _, or $ + - the first character cannot be a decimal digit + - identifiers are case sensitive + + Author: christine@netscape.com + Date: 11 september 1997 +*/ + var SECTION = "7.5-9-n"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Identifiers"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item] = new TestCase( SECTION, "var 123=\"hi\"", "error", "" ); + + var 123 = "hi"; + + array[item] = 123; + + return ( array ); +} + +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].actual = eval( testcases[tc].actual ); + + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +": "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : " ignored chars after line terminator of single-line comment"; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.6.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.6.js new file mode 100644 index 0000000..68b66be --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.6.js @@ -0,0 +1,309 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.6.js + ECMA Section: Punctuators + Description: + + This tests verifies that all ECMA punctutors are recognized as a + token separator, but does not attempt to verify the functionality + of any punctuator. + + Author: christine@netscape.com + Date: 12 november 1997 +*/ + + var SECTION = "7.6"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Punctuators"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = new Array(); + + // == + testcases[tc++] = new TestCase( SECTION, + "var c,d;c==d", + true, + eval("var c,d;c==d") ); + + // = + + testcases[tc++] = new TestCase( SECTION, + "var a=true;a", + true, + eval("var a=true;a") ); + + // > + testcases[tc++] = new TestCase( SECTION, + "var a=true,b=false;a>b", + true, + eval("var a=true,b=false;a>b") ); + + // < + testcases[tc++] = new TestCase( SECTION, + "var a=true,b=false;a<b", + false, + eval("var a=true,b=false;a<b") ); + + // <= + testcases[tc++] = new TestCase( SECTION, + "var a=0xFFFF,b=0X0FFF;a<=b", + false, + eval("var a=0xFFFF,b=0X0FFF;a<=b") ); + + // >= + testcases[tc++] = new TestCase( SECTION, + "var a=0xFFFF,b=0XFFFE;a>=b", + true, + eval("var a=0xFFFF,b=0XFFFE;a>=b") ); + + // != + testcases[tc++] = new TestCase( SECTION, + "var a=true,b=false;a!=b", + true, + eval("var a=true,b=false;a!=b") ); + + testcases[tc++] = new TestCase( SECTION, + "var a=false,b=false;a!=b", + false, + eval("var a=false,b=false;a!=b") ); + // , + testcases[tc++] = new TestCase( SECTION, + "var a=true,b=false;a,b", + false, + eval("var a=true,b=false;a,b") ); + // ! + testcases[tc++] = new TestCase( SECTION, + "var a=true,b=false;!a", + false, + eval("var a=true,b=false;!a") ); + + // ~ + testcases[tc++] = new TestCase( SECTION, + "var a=true;~a", + -2, + eval("var a=true;~a") ); + // ? + testcases[tc++] = new TestCase( SECTION, + "var a=true; (a ? 'PASS' : '')", + "PASS", + eval("var a=true; (a ? 'PASS' : '')") ); + + // : + + testcases[tc++] = new TestCase( SECTION, + "var a=false; (a ? 'FAIL' : 'PASS')", + "PASS", + eval("var a=false; (a ? 'FAIL' : 'PASS')") ); + // . + + testcases[tc++] = new TestCase( SECTION, + "var a=Number;a.NaN", + NaN, + eval("var a=Number;a.NaN") ); + + // && + testcases[tc++] = new TestCase( SECTION, + "var a=true,b=true;if(a&&b)'PASS';else'FAIL'", + "PASS", + eval("var a=true,b=true;if(a&&b)'PASS';else'FAIL'") ); + + // || + testcases[tc++] = new TestCase( SECTION, + "var a=false,b=false;if(a||b)'FAIL';else'PASS'", + "PASS", + eval("var a=false,b=false;if(a||b)'FAIL';else'PASS'") ); + // ++ + testcases[tc++] = new TestCase( SECTION, + "var a=false,b=false;++a", + 1, + eval("var a=false,b=false;++a") ); + // -- + testcases[tc++] = new TestCase( SECTION, + "var a=true,b=false--a", + 0, + eval("var a=true,b=false;--a") ); + // + + + testcases[tc++] = new TestCase( SECTION, + "var a=true,b=true;a+b", + 2, + eval("var a=true,b=true;a+b") ); + // - + testcases[tc++] = new TestCase( SECTION, + "var a=true,b=true;a-b", + 0, + eval("var a=true,b=true;a-b") ); + // * + testcases[tc++] = new TestCase( SECTION, + "var a=true,b=true;a*b", + 1, + eval("var a=true,b=true;a*b") ); + // / + testcases[tc++] = new TestCase( SECTION, + "var a=true,b=true;a/b", + 1, + eval("var a=true,b=true;a/b") ); + // & + testcases[tc++] = new TestCase( SECTION, + "var a=3,b=2;a&b", + 2, + eval("var a=3,b=2;a&b") ); + // | + testcases[tc++] = new TestCase( SECTION, + "var a=4,b=3;a|b", + 7, + eval("var a=4,b=3;a|b") ); + + // | + testcases[tc++] = new TestCase( SECTION, + "var a=4,b=3;a^b", + 7, + eval("var a=4,b=3;a^b") ); + + // % + testcases[tc++] = new TestCase( SECTION, + "var a=4,b=3;a|b", + 1, + eval("var a=4,b=3;a%b") ); + + // << + testcases[tc++] = new TestCase( SECTION, + "var a=4,b=3;a<<b", + 32, + eval("var a=4,b=3;a<<b") ); + + // >> + testcases[tc++] = new TestCase( SECTION, + "var a=4,b=1;a>>b", + 2, + eval("var a=4,b=1;a>>b") ); + + // >>> + testcases[tc++] = new TestCase( SECTION, + "var a=1,b=1;a>>>b", + 0, + eval("var a=1,b=1;a>>>b") ); + // += + testcases[tc++] = new TestCase( SECTION, + "var a=4,b=3;a+=b;a", + 7, + eval("var a=4,b=3;a+=b;a") ); + + // -= + testcases[tc++] = new TestCase( SECTION, + "var a=4,b=3;a-=b;a", + 1, + eval("var a=4,b=3;a-=b;a") ); + // *= + testcases[tc++] = new TestCase( SECTION, + "var a=4,b=3;a*=b;a", + 12, + eval("var a=4,b=3;a*=b;a") ); + // += + testcases[tc++] = new TestCase( SECTION, + "var a=4,b=3;a+=b;a", + 7, + eval("var a=4,b=3;a+=b;a") ); + // /= + testcases[tc++] = new TestCase( SECTION, + "var a=12,b=3;a/=b;a", + 4, + eval("var a=12,b=3;a/=b;a") ); + + // &= + testcases[tc++] = new TestCase( SECTION, + "var a=4,b=5;a&=b;a", + 4, + eval("var a=4,b=5;a&=b;a") ); + + // |= + testcases[tc++] = new TestCase( SECTION, + "var a=4,b=5;a&=b;a", + 5, + eval("var a=4,b=5;a|=b;a") ); + // ^= + testcases[tc++] = new TestCase( SECTION, + "var a=4,b=5;a^=b;a", + 1, + eval("var a=4,b=5;a^=b;a") ); + // %= + testcases[tc++] = new TestCase( SECTION, + "var a=12,b=5;a%=b;a", + 2, + eval("var a=12,b=5;a%=b;a") ); + // <<= + testcases[tc++] = new TestCase( SECTION, + "var a=4,b=3;a<<=b;a", + 32, + eval("var a=4,b=3;a<<=b;a") ); + + // >> + testcases[tc++] = new TestCase( SECTION, + "var a=4,b=1;a>>=b;a", + 2, + eval("var a=4,b=1;a>>=b;a") ); + + // >>> + testcases[tc++] = new TestCase( SECTION, + "var a=1,b=1;a>>>=b;a", + 0, + eval("var a=1,b=1;a>>>=b;a") ); + + // () + testcases[tc++] = new TestCase( SECTION, + "var a=4,b=3;(a)", + 4, + eval("var a=4,b=3;(a)") ); + // {} + testcases[tc++] = new TestCase( SECTION, + "var a=4,b=3;{b}", + 3, + eval("var a=4,b=3;{b}") ); + + // [] + testcases[tc++] = new TestCase( SECTION, + "var a=new Array('hi');a[0]", + "hi", + eval("var a=new Array('hi');a[0]") ); + // [] + testcases[tc++] = new TestCase( SECTION, + ";", + void 0, + eval(";") ); + test(); + +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ + testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; + } + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.7.1.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.7.1.js new file mode 100644 index 0000000..a939e51 --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.7.1.js @@ -0,0 +1,72 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.7.1.js + ECMA Section: 7.7.1 Null Literals + + Description: NullLiteral:: + null + + + The value of the null literal null is the sole value + of the Null type, namely null. + + Author: christine@netscape.com + Date: 21 october 1997 +*/ + var SECTION = "7.7.1"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Null Literals"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "null", null, null); + + return ( array ); +} + +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].actual = testcases[tc].actual; + + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; + } + + stopTest(); + + // all tests must return the test array + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.7.2.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.7.2.js new file mode 100644 index 0000000..1202df3 --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.7.2.js @@ -0,0 +1,75 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.7.2.js + ECMA Section: 7.7.2 Boolean Literals + + Description: BooleanLiteral:: + true + false + + The value of the Boolean literal true is a value of the + Boolean type, namely true. + + The value of the Boolean literal false is a value of the + Boolean type, namely false. + + Author: christine@netscape.com + Date: 16 september 1997 +*/ + + var SECTION = "7.7.2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Boolean Literals"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // StringLiteral:: "" and '' + + array[item++] = new TestCase( SECTION, "true", Boolean(true), true ); + array[item++] = new TestCase( SECTION, "false", Boolean(false), false ); + + return ( array ); +} +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].actual = testcases[tc].actual; + + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; + + stopTest(); + } + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.7.3-1.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.7.3-1.js new file mode 100644 index 0000000..91becca --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.7.3-1.js @@ -0,0 +1,197 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.7.3-1.js + ECMA Section: 7.7.3 Numeric Literals + + Description: A numeric literal stands for a value of the Number type + This value is determined in two steps: first a + mathematical value (MV) is derived from the literal; + second, this mathematical value is rounded, ideally + using IEEE 754 round-to-nearest mode, to a reprentable + value of of the number type. + + These test cases came from Waldemar. + + Author: christine@netscape.com + Date: 12 June 1998 +*/ + +var SECTION = "7.7.3-1"; +var VERSION = "ECMA_1"; + startTest(); +var TITLE = "Numeric Literals"; +var BUGNUMBER="122877"; + +writeHeaderToLog( SECTION + " "+ TITLE); + +var testcases = new Array(); + + +testcases[tc++] = new TestCase( SECTION, + "0x12345678", + 305419896, + 0x12345678 ); + +testcases[tc++] = new TestCase( SECTION, + "0x80000000", + 2147483648, + 0x80000000 ); + +testcases[tc++] = new TestCase( SECTION, + "0xffffffff", + 4294967295, + 0xffffffff ); + +testcases[tc++] = new TestCase( SECTION, + "0x100000000", + 4294967296, + 0x100000000 ); + +testcases[tc++] = new TestCase( SECTION, + "077777777777777777", + 2251799813685247, + 077777777777777777 ); + +testcases[tc++] = new TestCase( SECTION, + "077777777777777776", + 2251799813685246, + 077777777777777776 ); + +testcases[tc++] = new TestCase( SECTION, + "0x1fffffffffffff", + 9007199254740991, + 0x1fffffffffffff ); + +testcases[tc++] = new TestCase( SECTION, + "0x20000000000000", + 9007199254740992, + 0x20000000000000 ); + +testcases[tc++] = new TestCase( SECTION, + "0x20123456789abc", + 9027215253084860, + 0x20123456789abc ); + +testcases[tc++] = new TestCase( SECTION, + "0x20123456789abd", + 9027215253084860, + 0x20123456789abd ); + +testcases[tc++] = new TestCase( SECTION, + "0x20123456789abe", + 9027215253084862, + 0x20123456789abe ); + +testcases[tc++] = new TestCase( SECTION, + "0x20123456789abf", + 9027215253084864, + 0x20123456789abf ); + +testcases[tc++] = new TestCase( SECTION, + "0x1000000000000080", + 1152921504606847000, + 0x1000000000000080 ); + +testcases[tc++] = new TestCase( SECTION, + "0x1000000000000081", + 1152921504606847200, + 0x1000000000000081 ); + +testcases[tc++] = new TestCase( SECTION, + "0x1000000000000100", + 1152921504606847200, + 0x1000000000000100 ); + +testcases[tc++] = new TestCase( SECTION, + "0x100000000000017f", + 1152921504606847200, + 0x100000000000017f ); + +testcases[tc++] = new TestCase( SECTION, + "0x1000000000000180", + 1152921504606847500, + 0x1000000000000180 ); + +testcases[tc++] = new TestCase( SECTION, + "0x1000000000000181", + 1152921504606847500, + 0x1000000000000181 ); + +testcases[tc++] = new TestCase( SECTION, + "0x10000000000001f0", + 1152921504606847500, + 0x10000000000001f0 ); + +testcases[tc++] = new TestCase( SECTION, + "0x1000000000000200", + 1152921504606847500, + 0x1000000000000200 ); + +testcases[tc++] = new TestCase( SECTION, + "0x100000000000027f", + 1152921504606847500, + 0x100000000000027f ); + +testcases[tc++] = new TestCase( SECTION, + "0x1000000000000280", + 1152921504606847500, + 0x1000000000000280 ); + +testcases[tc++] = new TestCase( SECTION, + "0x1000000000000281", + 1152921504606847700, + 0x1000000000000281 ); + +testcases[tc++] = new TestCase( SECTION, + "0x10000000000002ff", + 1152921504606847700, + 0x10000000000002ff ); + +testcases[tc++] = new TestCase( SECTION, + "0x1000000000000300", + 1152921504606847700, + 0x1000000000000300 ); + +testcases[tc++] = new TestCase( SECTION, + "0x10000000000000000", + 18446744073709552000, + 0x10000000000000000 ); + +test(); + +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].actual = testcases[tc].actual; + + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; + + } + + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.7.3-2.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.7.3-2.js new file mode 100644 index 0000000..b6e750c --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.7.3-2.js @@ -0,0 +1,93 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.7.3-2.js + ECMA Section: 7.7.3 Numeric Literals + + Description: + + This is a regression test for + http://scopus.mcom.com/bugsplat/show_bug.cgi?id=122884 + + Waldemar's comments: + + A numeric literal that starts with either '08' or '09' is interpreted as a + decimal literal; it should be an error instead. (Strictly speaking, according + to ECMA v1 such literals should be interpreted as two integers -- a zero + followed by a decimal number whose first digit is 8 or 9, but this is a bug in + ECMA that will be fixed in v2. In any case, there is no place in the grammar + where two consecutive numbers would be legal.) + + Author: christine@netscape.com + Date: 15 june 1998 + +*/ + var SECTION = "7.7.3-2"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Numeric Literals"; + var BUGNUMBER="122884"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = new Array(); + + testcases[tc++] = new TestCase( SECTION, + "9", + 9, + 9 ); + + testcases[tc++] = new TestCase( SECTION, + "09", + 9, + 09 ); + + testcases[tc++] = new TestCase( SECTION, + "099", + 99, + 099 ); + + + testcases[tc++] = new TestCase( SECTION, + "077", + 63, + 077 ); + + test(); + + +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].actual = testcases[tc].actual; + + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; + + } + + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.7.3.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.7.3.js new file mode 100644 index 0000000..7d47a40 --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.7.3.js @@ -0,0 +1,337 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.7.3.js + ECMA Section: 7.7.3 Numeric Literals + + Description: A numeric literal stands for a value of the Number type + This value is determined in two steps: first a + mathematical value (MV) is derived from the literal; + second, this mathematical value is rounded, ideally + using IEEE 754 round-to-nearest mode, to a reprentable + value of of the number type. + + Author: christine@netscape.com + Date: 16 september 1997 +*/ + var SECTION = "7.7.3"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "Numeric Literals"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + + +function getTestCases() { + var array = new Array(); + var item = 0; + + array[item++] = new TestCase( SECTION, "0", 0, 0 ); + array[item++] = new TestCase( SECTION, "1", 1, 1 ); + array[item++] = new TestCase( SECTION, "2", 2, 2 ); + array[item++] = new TestCase( SECTION, "3", 3, 3 ); + array[item++] = new TestCase( SECTION, "4", 4, 4 ); + array[item++] = new TestCase( SECTION, "5", 5, 5 ); + array[item++] = new TestCase( SECTION, "6", 6, 6 ); + array[item++] = new TestCase( SECTION, "7", 7, 7 ); + array[item++] = new TestCase( SECTION, "8", 8, 8 ); + array[item++] = new TestCase( SECTION, "9", 9, 9 ); + + array[item++] = new TestCase( SECTION, "0.", 0, 0. ); + array[item++] = new TestCase( SECTION, "1.", 1, 1. ); + array[item++] = new TestCase( SECTION, "2.", 2, 2. ); + array[item++] = new TestCase( SECTION, "3.", 3, 3. ); + array[item++] = new TestCase( SECTION, "4.", 4, 4. ); + + array[item++] = new TestCase( SECTION, "0.e0", 0, 0.e0 ); + array[item++] = new TestCase( SECTION, "1.e1", 10, 1.e1 ); + array[item++] = new TestCase( SECTION, "2.e2", 200, 2.e2 ); + array[item++] = new TestCase( SECTION, "3.e3", 3000, 3.e3 ); + array[item++] = new TestCase( SECTION, "4.e4", 40000, 4.e4 ); + + array[item++] = new TestCase( SECTION, "0.1e0", .1, 0.1e0 ); + array[item++] = new TestCase( SECTION, "1.1e1", 11, 1.1e1 ); + array[item++] = new TestCase( SECTION, "2.2e2", 220, 2.2e2 ); + array[item++] = new TestCase( SECTION, "3.3e3", 3300, 3.3e3 ); + array[item++] = new TestCase( SECTION, "4.4e4", 44000, 4.4e4 ); + + array[item++] = new TestCase( SECTION, ".1e0", .1, .1e0 ); + array[item++] = new TestCase( SECTION, ".1e1", 1, .1e1 ); + array[item++] = new TestCase( SECTION, ".2e2", 20, .2e2 ); + array[item++] = new TestCase( SECTION, ".3e3", 300, .3e3 ); + array[item++] = new TestCase( SECTION, ".4e4", 4000, .4e4 ); + + array[item++] = new TestCase( SECTION, "0e0", 0, 0e0 ); + array[item++] = new TestCase( SECTION, "1e1", 10, 1e1 ); + array[item++] = new TestCase( SECTION, "2e2", 200, 2e2 ); + array[item++] = new TestCase( SECTION, "3e3", 3000, 3e3 ); + array[item++] = new TestCase( SECTION, "4e4", 40000, 4e4 ); + + array[item++] = new TestCase( SECTION, "0e0", 0, 0e0 ); + array[item++] = new TestCase( SECTION, "1e1", 10, 1e1 ); + array[item++] = new TestCase( SECTION, "2e2", 200, 2e2 ); + array[item++] = new TestCase( SECTION, "3e3", 3000, 3e3 ); + array[item++] = new TestCase( SECTION, "4e4", 40000, 4e4 ); + + array[item++] = new TestCase( SECTION, "0E0", 0, 0E0 ); + array[item++] = new TestCase( SECTION, "1E1", 10, 1E1 ); + array[item++] = new TestCase( SECTION, "2E2", 200, 2E2 ); + array[item++] = new TestCase( SECTION, "3E3", 3000, 3E3 ); + array[item++] = new TestCase( SECTION, "4E4", 40000, 4E4 ); + + array[item++] = new TestCase( SECTION, "1.e-1", 0.1, 1.e-1 ); + array[item++] = new TestCase( SECTION, "2.e-2", 0.02, 2.e-2 ); + array[item++] = new TestCase( SECTION, "3.e-3", 0.003, 3.e-3 ); + array[item++] = new TestCase( SECTION, "4.e-4", 0.0004, 4.e-4 ); + + array[item++] = new TestCase( SECTION, "0.1e-0", .1, 0.1e-0 ); + array[item++] = new TestCase( SECTION, "1.1e-1", 0.11, 1.1e-1 ); + array[item++] = new TestCase( SECTION, "2.2e-2", .022, 2.2e-2 ); + array[item++] = new TestCase( SECTION, "3.3e-3", .0033, 3.3e-3 ); + array[item++] = new TestCase( SECTION, "4.4e-4", .00044, 4.4e-4 ); + + array[item++] = new TestCase( SECTION, ".1e-0", .1, .1e-0 ); + array[item++] = new TestCase( SECTION, ".1e-1", .01, .1e-1 ); + array[item++] = new TestCase( SECTION, ".2e-2", .002, .2e-2 ); + array[item++] = new TestCase( SECTION, ".3e-3", .0003, .3e-3 ); + array[item++] = new TestCase( SECTION, ".4e-4", .00004, .4e-4 ); + + array[item++] = new TestCase( SECTION, "1.e+1", 10, 1.e+1 ); + array[item++] = new TestCase( SECTION, "2.e+2", 200, 2.e+2 ); + array[item++] = new TestCase( SECTION, "3.e+3", 3000, 3.e+3 ); + array[item++] = new TestCase( SECTION, "4.e+4", 40000, 4.e+4 ); + + array[item++] = new TestCase( SECTION, "0.1e+0", .1, 0.1e+0 ); + array[item++] = new TestCase( SECTION, "1.1e+1", 11, 1.1e+1 ); + array[item++] = new TestCase( SECTION, "2.2e+2", 220, 2.2e+2 ); + array[item++] = new TestCase( SECTION, "3.3e+3", 3300, 3.3e+3 ); + array[item++] = new TestCase( SECTION, "4.4e+4", 44000, 4.4e+4 ); + + array[item++] = new TestCase( SECTION, ".1e+0", .1, .1e+0 ); + array[item++] = new TestCase( SECTION, ".1e+1", 1, .1e+1 ); + array[item++] = new TestCase( SECTION, ".2e+2", 20, .2e+2 ); + array[item++] = new TestCase( SECTION, ".3e+3", 300, .3e+3 ); + array[item++] = new TestCase( SECTION, ".4e+4", 4000, .4e+4 ); + + array[item++] = new TestCase( SECTION, "0x0", 0, 0x0 ); + array[item++] = new TestCase( SECTION, "0x1", 1, 0x1 ); + array[item++] = new TestCase( SECTION, "0x2", 2, 0x2 ); + array[item++] = new TestCase( SECTION, "0x3", 3, 0x3 ); + array[item++] = new TestCase( SECTION, "0x4", 4, 0x4 ); + array[item++] = new TestCase( SECTION, "0x5", 5, 0x5 ); + array[item++] = new TestCase( SECTION, "0x6", 6, 0x6 ); + array[item++] = new TestCase( SECTION, "0x7", 7, 0x7 ); + array[item++] = new TestCase( SECTION, "0x8", 8, 0x8 ); + array[item++] = new TestCase( SECTION, "0x9", 9, 0x9 ); + array[item++] = new TestCase( SECTION, "0xa", 10, 0xa ); + array[item++] = new TestCase( SECTION, "0xb", 11, 0xb ); + array[item++] = new TestCase( SECTION, "0xc", 12, 0xc ); + array[item++] = new TestCase( SECTION, "0xd", 13, 0xd ); + array[item++] = new TestCase( SECTION, "0xe", 14, 0xe ); + array[item++] = new TestCase( SECTION, "0xf", 15, 0xf ); + + array[item++] = new TestCase( SECTION, "0X0", 0, 0X0 ); + array[item++] = new TestCase( SECTION, "0X1", 1, 0X1 ); + array[item++] = new TestCase( SECTION, "0X2", 2, 0X2 ); + array[item++] = new TestCase( SECTION, "0X3", 3, 0X3 ); + array[item++] = new TestCase( SECTION, "0X4", 4, 0X4 ); + array[item++] = new TestCase( SECTION, "0X5", 5, 0X5 ); + array[item++] = new TestCase( SECTION, "0X6", 6, 0X6 ); + array[item++] = new TestCase( SECTION, "0X7", 7, 0X7 ); + array[item++] = new TestCase( SECTION, "0X8", 8, 0X8 ); + array[item++] = new TestCase( SECTION, "0X9", 9, 0X9 ); + array[item++] = new TestCase( SECTION, "0Xa", 10, 0Xa ); + array[item++] = new TestCase( SECTION, "0Xb", 11, 0Xb ); + array[item++] = new TestCase( SECTION, "0Xc", 12, 0Xc ); + array[item++] = new TestCase( SECTION, "0Xd", 13, 0Xd ); + array[item++] = new TestCase( SECTION, "0Xe", 14, 0Xe ); + array[item++] = new TestCase( SECTION, "0Xf", 15, 0Xf ); + + array[item++] = new TestCase( SECTION, "0x0", 0, 0x0 ); + array[item++] = new TestCase( SECTION, "0x1", 1, 0x1 ); + array[item++] = new TestCase( SECTION, "0x2", 2, 0x2 ); + array[item++] = new TestCase( SECTION, "0x3", 3, 0x3 ); + array[item++] = new TestCase( SECTION, "0x4", 4, 0x4 ); + array[item++] = new TestCase( SECTION, "0x5", 5, 0x5 ); + array[item++] = new TestCase( SECTION, "0x6", 6, 0x6 ); + array[item++] = new TestCase( SECTION, "0x7", 7, 0x7 ); + array[item++] = new TestCase( SECTION, "0x8", 8, 0x8 ); + array[item++] = new TestCase( SECTION, "0x9", 9, 0x9 ); + array[item++] = new TestCase( SECTION, "0xA", 10, 0xA ); + array[item++] = new TestCase( SECTION, "0xB", 11, 0xB ); + array[item++] = new TestCase( SECTION, "0xC", 12, 0xC ); + array[item++] = new TestCase( SECTION, "0xD", 13, 0xD ); + array[item++] = new TestCase( SECTION, "0xE", 14, 0xE ); + array[item++] = new TestCase( SECTION, "0xF", 15, 0xF ); + + array[item++] = new TestCase( SECTION, "0X0", 0, 0X0 ); + array[item++] = new TestCase( SECTION, "0X1", 1, 0X1 ); + array[item++] = new TestCase( SECTION, "0X2", 2, 0X2 ); + array[item++] = new TestCase( SECTION, "0X3", 3, 0X3 ); + array[item++] = new TestCase( SECTION, "0X4", 4, 0X4 ); + array[item++] = new TestCase( SECTION, "0X5", 5, 0X5 ); + array[item++] = new TestCase( SECTION, "0X6", 6, 0X6 ); + array[item++] = new TestCase( SECTION, "0X7", 7, 0X7 ); + array[item++] = new TestCase( SECTION, "0X8", 8, 0X8 ); + array[item++] = new TestCase( SECTION, "0X9", 9, 0X9 ); + array[item++] = new TestCase( SECTION, "0XA", 10, 0XA ); + array[item++] = new TestCase( SECTION, "0XB", 11, 0XB ); + array[item++] = new TestCase( SECTION, "0XC", 12, 0XC ); + array[item++] = new TestCase( SECTION, "0XD", 13, 0XD ); + array[item++] = new TestCase( SECTION, "0XE", 14, 0XE ); + array[item++] = new TestCase( SECTION, "0XF", 15, 0XF ); + + + array[item++] = new TestCase( SECTION, "00", 0, 00 ); + array[item++] = new TestCase( SECTION, "01", 1, 01 ); + array[item++] = new TestCase( SECTION, "02", 2, 02 ); + array[item++] = new TestCase( SECTION, "03", 3, 03 ); + array[item++] = new TestCase( SECTION, "04", 4, 04 ); + array[item++] = new TestCase( SECTION, "05", 5, 05 ); + array[item++] = new TestCase( SECTION, "06", 6, 06 ); + array[item++] = new TestCase( SECTION, "07", 7, 07 ); + + array[item++] = new TestCase( SECTION, "000", 0, 000 ); + array[item++] = new TestCase( SECTION, "011", 9, 011 ); + array[item++] = new TestCase( SECTION, "022", 18, 022 ); + array[item++] = new TestCase( SECTION, "033", 27, 033 ); + array[item++] = new TestCase( SECTION, "044", 36, 044 ); + array[item++] = new TestCase( SECTION, "055", 45, 055 ); + array[item++] = new TestCase( SECTION, "066", 54, 066 ); + array[item++] = new TestCase( SECTION, "077", 63, 077 ); + + array[item++] = new TestCase( SECTION, "0.00000000001", 0.00000000001, 0.00000000001 ); + array[item++] = new TestCase( SECTION, "0.00000000001e-2", 0.0000000000001, 0.00000000001e-2 ); + + + array[item++] = new TestCase( SECTION, + "123456789012345671.9999", + "123456789012345660", + 123456789012345671.9999 +""); + array[item++] = new TestCase( SECTION, + "123456789012345672", + "123456789012345660", + 123456789012345672 +""); + + array[item++] = new TestCase( SECTION, + "123456789012345672.000000000000000000000000000", + "123456789012345660", + 123456789012345672.000000000000000000000000000 +""); + + array[item++] = new TestCase( SECTION, + "123456789012345672.01", + "123456789012345680", + 123456789012345672.01 +""); + + array[item++] = new TestCase( SECTION, + "123456789012345672.000000000000000000000000001+'' == 123456789012345680 || 123456789012345660", + true, + ( 123456789012345672.00000000000000000000000000 +"" == 1234567890 * 100000000 + 12345680 ) + || + ( 123456789012345672.00000000000000000000000000 +"" == 1234567890 * 100000000 + 12345660) ); + + array[item++] = new TestCase( SECTION, + "123456789012345673", + "123456789012345680", + 123456789012345673 +"" ); + + array[item++] = new TestCase( SECTION, + "-123456789012345671.9999", + "-123456789012345660", + -123456789012345671.9999 +"" ); + + array[item++] = new TestCase( SECTION, + "-123456789012345672", + "-123456789012345660", + -123456789012345672+""); + + array[item++] = new TestCase( SECTION, + "-123456789012345672.000000000000000000000000000", + "-123456789012345660", + -123456789012345672.000000000000000000000000000 +""); + + array[item++] = new TestCase( SECTION, + "-123456789012345672.01", + "-123456789012345680", + -123456789012345672.01 +"" ); + + array[item++] = new TestCase( SECTION, + "-123456789012345672.000000000000000000000000001 == -123456789012345680 or -123456789012345660", + true, + (-123456789012345672.000000000000000000000000001 +"" == -1234567890 * 100000000 -12345680) + || + (-123456789012345672.000000000000000000000000001 +"" == -1234567890 * 100000000 -12345660)); + + array[item++] = new TestCase( SECTION, + -123456789012345673, + "-123456789012345680", + -123456789012345673 +""); + + array[item++] = new TestCase( SECTION, + "12345678901234567890", + "12345678901234567000", + 12345678901234567890 +"" ); + + +/* + array[item++] = new TestCase( SECTION, "12345678901234567", "12345678901234567", 12345678901234567+"" ); + array[item++] = new TestCase( SECTION, "123456789012345678", "123456789012345678", 123456789012345678+"" ); + array[item++] = new TestCase( SECTION, "1234567890123456789", "1234567890123456789", 1234567890123456789+"" ); + array[item++] = new TestCase( SECTION, "12345678901234567890", "12345678901234567890", 12345678901234567890+"" ); + array[item++] = new TestCase( SECTION, "123456789012345678900", "123456789012345678900", 123456789012345678900+"" ); + array[item++] = new TestCase( SECTION, "1234567890123456789000", "1234567890123456789000", 1234567890123456789000+"" ); +*/ + array[item++] = new TestCase( SECTION, "0x1", 1, 0x1 ); + array[item++] = new TestCase( SECTION, "0x10", 16, 0x10 ); + array[item++] = new TestCase( SECTION, "0x100", 256, 0x100 ); + array[item++] = new TestCase( SECTION, "0x1000", 4096, 0x1000 ); + array[item++] = new TestCase( SECTION, "0x10000", 65536, 0x10000 ); + array[item++] = new TestCase( SECTION, "0x100000", 1048576, 0x100000 ); + array[item++] = new TestCase( SECTION, "0x1000000", 16777216, 0x1000000 ); + array[item++] = new TestCase( SECTION, "0x10000000", 268435456, 0x10000000 ); +/* + array[item++] = new TestCase( SECTION, "0x100000000", 4294967296, 0x100000000 ); + array[item++] = new TestCase( SECTION, "0x1000000000", 68719476736, 0x1000000000 ); + array[item++] = new TestCase( SECTION, "0x10000000000", 1099511627776, 0x10000000000 ); +*/ + return ( array ); +} + +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].actual = testcases[tc].actual; + + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; + + } + + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.7.4.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.7.4.js new file mode 100644 index 0000000..769b819 --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.7.4.js @@ -0,0 +1,275 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.7.4.js + ECMA Section: 7.7.4 String Literals + + Description: A string literal is zero or more characters enclosed in + single or double quotes. Each character may be + represented by an escape sequence. + + + Author: christine@netscape.com + Date: 16 september 1997 +*/ + + var SECTION = "7.7.4"; + var VERSION = "ECMA_1"; + startTest(); + var TITLE = "String Literals"; + + writeHeaderToLog( SECTION + " "+ TITLE); + + var testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + + // StringLiteral:: "" and '' + + array[item++] = new TestCase( SECTION, "\"\"", "", "" ); + array[item++] = new TestCase( SECTION, "\'\'", "", '' ); + + // DoubleStringCharacters:: DoubleStringCharacter :: EscapeSequence :: CharacterEscapeSequence + array[item++] = new TestCase( SECTION, "\\\"", String.fromCharCode(0x0022), "\"" ); + array[item++] = new TestCase( SECTION, "\\\'", String.fromCharCode(0x0027), "\'" ); + array[item++] = new TestCase( SECTION, "\\", String.fromCharCode(0x005C), "\\" ); + array[item++] = new TestCase( SECTION, "\\b", String.fromCharCode(0x0008), "\b" ); + array[item++] = new TestCase( SECTION, "\\f", String.fromCharCode(0x000C), "\f" ); + array[item++] = new TestCase( SECTION, "\\n", String.fromCharCode(0x000A), "\n" ); + array[item++] = new TestCase( SECTION, "\\r", String.fromCharCode(0x000D), "\r" ); + array[item++] = new TestCase( SECTION, "\\t", String.fromCharCode(0x0009), "\t" ); + array[item++] = new TestCase( SECTION, "\\v", String.fromCharCode(0x000B), "\v" ); + + // DoubleStringCharacters:DoubleStringCharacter::EscapeSequence::OctalEscapeSequence + + array[item++] = new TestCase( SECTION, "\\00", String.fromCharCode(0x0000), "\00" ); + array[item++] = new TestCase( SECTION, "\\01", String.fromCharCode(0x0001), "\01" ); + array[item++] = new TestCase( SECTION, "\\02", String.fromCharCode(0x0002), "\02" ); + array[item++] = new TestCase( SECTION, "\\03", String.fromCharCode(0x0003), "\03" ); + array[item++] = new TestCase( SECTION, "\\04", String.fromCharCode(0x0004), "\04" ); + array[item++] = new TestCase( SECTION, "\\05", String.fromCharCode(0x0005), "\05" ); + array[item++] = new TestCase( SECTION, "\\06", String.fromCharCode(0x0006), "\06" ); + array[item++] = new TestCase( SECTION, "\\07", String.fromCharCode(0x0007), "\07" ); + + array[item++] = new TestCase( SECTION, "\\010", String.fromCharCode(0x0008), "\010" ); + array[item++] = new TestCase( SECTION, "\\011", String.fromCharCode(0x0009), "\011" ); + array[item++] = new TestCase( SECTION, "\\012", String.fromCharCode(0x000A), "\012" ); + array[item++] = new TestCase( SECTION, "\\013", String.fromCharCode(0x000B), "\013" ); + array[item++] = new TestCase( SECTION, "\\014", String.fromCharCode(0x000C), "\014" ); + array[item++] = new TestCase( SECTION, "\\015", String.fromCharCode(0x000D), "\015" ); + array[item++] = new TestCase( SECTION, "\\016", String.fromCharCode(0x000E), "\016" ); + array[item++] = new TestCase( SECTION, "\\017", String.fromCharCode(0x000F), "\017" ); + array[item++] = new TestCase( SECTION, "\\020", String.fromCharCode(0x0010), "\020" ); + array[item++] = new TestCase( SECTION, "\\042", String.fromCharCode(0x0022), "\042" ); + + array[item++] = new TestCase( SECTION, "\\0", String.fromCharCode(0x0000), "\0" ); + array[item++] = new TestCase( SECTION, "\\1", String.fromCharCode(0x0001), "\1" ); + array[item++] = new TestCase( SECTION, "\\2", String.fromCharCode(0x0002), "\2" ); + array[item++] = new TestCase( SECTION, "\\3", String.fromCharCode(0x0003), "\3" ); + array[item++] = new TestCase( SECTION, "\\4", String.fromCharCode(0x0004), "\4" ); + array[item++] = new TestCase( SECTION, "\\5", String.fromCharCode(0x0005), "\5" ); + array[item++] = new TestCase( SECTION, "\\6", String.fromCharCode(0x0006), "\6" ); + array[item++] = new TestCase( SECTION, "\\7", String.fromCharCode(0x0007), "\7" ); + + array[item++] = new TestCase( SECTION, "\\10", String.fromCharCode(0x0008), "\10" ); + array[item++] = new TestCase( SECTION, "\\11", String.fromCharCode(0x0009), "\11" ); + array[item++] = new TestCase( SECTION, "\\12", String.fromCharCode(0x000A), "\12" ); + array[item++] = new TestCase( SECTION, "\\13", String.fromCharCode(0x000B), "\13" ); + array[item++] = new TestCase( SECTION, "\\14", String.fromCharCode(0x000C), "\14" ); + array[item++] = new TestCase( SECTION, "\\15", String.fromCharCode(0x000D), "\15" ); + array[item++] = new TestCase( SECTION, "\\16", String.fromCharCode(0x000E), "\16" ); + array[item++] = new TestCase( SECTION, "\\17", String.fromCharCode(0x000F), "\17" ); + array[item++] = new TestCase( SECTION, "\\20", String.fromCharCode(0x0010), "\20" ); + array[item++] = new TestCase( SECTION, "\\42", String.fromCharCode(0x0022), "\42" ); + + array[item++] = new TestCase( SECTION, "\\000", String.fromCharCode(0), "\000" ); + array[item++] = new TestCase( SECTION, "\\111", String.fromCharCode(73), "\111" ); + array[item++] = new TestCase( SECTION, "\\222", String.fromCharCode(146), "\222" ); + array[item++] = new TestCase( SECTION, "\\333", String.fromCharCode(219), "\333" ); + +// following line commented out as it causes a compile time error +// array[item++] = new TestCase( SECTION, "\\444", "444", "\444" ); + + // DoubleStringCharacters:DoubleStringCharacter::EscapeSequence::HexEscapeSequence +/* + array[item++] = new TestCase( SECTION, "\\x0", String.fromCharCode(0), "\x0" ); + array[item++] = new TestCase( SECTION, "\\x1", String.fromCharCode(1), "\x1" ); + array[item++] = new TestCase( SECTION, "\\x2", String.fromCharCode(2), "\x2" ); + array[item++] = new TestCase( SECTION, "\\x3", String.fromCharCode(3), "\x3" ); + array[item++] = new TestCase( SECTION, "\\x4", String.fromCharCode(4), "\x4" ); + array[item++] = new TestCase( SECTION, "\\x5", String.fromCharCode(5), "\x5" ); + array[item++] = new TestCase( SECTION, "\\x6", String.fromCharCode(6), "\x6" ); + array[item++] = new TestCase( SECTION, "\\x7", String.fromCharCode(7), "\x7" ); + array[item++] = new TestCase( SECTION, "\\x8", String.fromCharCode(8), "\x8" ); + array[item++] = new TestCase( SECTION, "\\x9", String.fromCharCode(9), "\x9" ); + array[item++] = new TestCase( SECTION, "\\xA", String.fromCharCode(10), "\xA" ); + array[item++] = new TestCase( SECTION, "\\xB", String.fromCharCode(11), "\xB" ); + array[item++] = new TestCase( SECTION, "\\xC", String.fromCharCode(12), "\xC" ); + array[item++] = new TestCase( SECTION, "\\xD", String.fromCharCode(13), "\xD" ); + array[item++] = new TestCase( SECTION, "\\xE", String.fromCharCode(14), "\xE" ); + array[item++] = new TestCase( SECTION, "\\xF", String.fromCharCode(15), "\xF" ); + +*/ + array[item++] = new TestCase( SECTION, "\\xF0", String.fromCharCode(240), "\xF0" ); + array[item++] = new TestCase( SECTION, "\\xE1", String.fromCharCode(225), "\xE1" ); + array[item++] = new TestCase( SECTION, "\\xD2", String.fromCharCode(210), "\xD2" ); + array[item++] = new TestCase( SECTION, "\\xC3", String.fromCharCode(195), "\xC3" ); + array[item++] = new TestCase( SECTION, "\\xB4", String.fromCharCode(180), "\xB4" ); + array[item++] = new TestCase( SECTION, "\\xA5", String.fromCharCode(165), "\xA5" ); + array[item++] = new TestCase( SECTION, "\\x96", String.fromCharCode(150), "\x96" ); + array[item++] = new TestCase( SECTION, "\\x87", String.fromCharCode(135), "\x87" ); + array[item++] = new TestCase( SECTION, "\\x78", String.fromCharCode(120), "\x78" ); + array[item++] = new TestCase( SECTION, "\\x69", String.fromCharCode(105), "\x69" ); + array[item++] = new TestCase( SECTION, "\\x5A", String.fromCharCode(90), "\x5A" ); + array[item++] = new TestCase( SECTION, "\\x4B", String.fromCharCode(75), "\x4B" ); + array[item++] = new TestCase( SECTION, "\\x3C", String.fromCharCode(60), "\x3C" ); + array[item++] = new TestCase( SECTION, "\\x2D", String.fromCharCode(45), "\x2D" ); + array[item++] = new TestCase( SECTION, "\\x1E", String.fromCharCode(30), "\x1E" ); + array[item++] = new TestCase( SECTION, "\\x0F", String.fromCharCode(15), "\x0F" ); + + // string literals only take up to two hext digits. therefore, the third character in this string + // should be interpreted as a StringCharacter and not part of the HextEscapeSequence + + array[item++] = new TestCase( SECTION, "\\xF0F", String.fromCharCode(240)+"F", "\xF0F" ); + array[item++] = new TestCase( SECTION, "\\xE1E", String.fromCharCode(225)+"E", "\xE1E" ); + array[item++] = new TestCase( SECTION, "\\xD2D", String.fromCharCode(210)+"D", "\xD2D" ); + array[item++] = new TestCase( SECTION, "\\xC3C", String.fromCharCode(195)+"C", "\xC3C" ); + array[item++] = new TestCase( SECTION, "\\xB4B", String.fromCharCode(180)+"B", "\xB4B" ); + array[item++] = new TestCase( SECTION, "\\xA5A", String.fromCharCode(165)+"A", "\xA5A" ); + array[item++] = new TestCase( SECTION, "\\x969", String.fromCharCode(150)+"9", "\x969" ); + array[item++] = new TestCase( SECTION, "\\x878", String.fromCharCode(135)+"8", "\x878" ); + array[item++] = new TestCase( SECTION, "\\x787", String.fromCharCode(120)+"7", "\x787" ); + array[item++] = new TestCase( SECTION, "\\x696", String.fromCharCode(105)+"6", "\x696" ); + array[item++] = new TestCase( SECTION, "\\x5A5", String.fromCharCode(90)+"5", "\x5A5" ); + array[item++] = new TestCase( SECTION, "\\x4B4", String.fromCharCode(75)+"4", "\x4B4" ); + array[item++] = new TestCase( SECTION, "\\x3C3", String.fromCharCode(60)+"3", "\x3C3" ); + array[item++] = new TestCase( SECTION, "\\x2D2", String.fromCharCode(45)+"2", "\x2D2" ); + array[item++] = new TestCase( SECTION, "\\x1E1", String.fromCharCode(30)+"1", "\x1E1" ); + array[item++] = new TestCase( SECTION, "\\x0F0", String.fromCharCode(15)+"0", "\x0F0" ); + + // G is out of hex range + + array[item++] = new TestCase( SECTION, "\\xG", "xG", "\xG" ); + array[item++] = new TestCase( SECTION, "\\xCG", "xCG", "\xCG" ); + + // DoubleStringCharacter::EscapeSequence::CharacterEscapeSequence::\ NonEscapeCharacter + array[item++] = new TestCase( SECTION, "\\a", "a", "\a" ); + array[item++] = new TestCase( SECTION, "\\c", "c", "\c" ); + array[item++] = new TestCase( SECTION, "\\d", "d", "\d" ); + array[item++] = new TestCase( SECTION, "\\e", "e", "\e" ); + array[item++] = new TestCase( SECTION, "\\g", "g", "\g" ); + array[item++] = new TestCase( SECTION, "\\h", "h", "\h" ); + array[item++] = new TestCase( SECTION, "\\i", "i", "\i" ); + array[item++] = new TestCase( SECTION, "\\j", "j", "\j" ); + array[item++] = new TestCase( SECTION, "\\k", "k", "\k" ); + array[item++] = new TestCase( SECTION, "\\l", "l", "\l" ); + array[item++] = new TestCase( SECTION, "\\m", "m", "\m" ); + array[item++] = new TestCase( SECTION, "\\o", "o", "\o" ); + array[item++] = new TestCase( SECTION, "\\p", "p", "\p" ); + array[item++] = new TestCase( SECTION, "\\q", "q", "\q" ); + array[item++] = new TestCase( SECTION, "\\s", "s", "\s" ); + array[item++] = new TestCase( SECTION, "\\u", "u", "\u" ); + + array[item++] = new TestCase( SECTION, "\\w", "w", "\w" ); + array[item++] = new TestCase( SECTION, "\\x", "x", "\x" ); + array[item++] = new TestCase( SECTION, "\\y", "y", "\y" ); + array[item++] = new TestCase( SECTION, "\\z", "z", "\z" ); + array[item++] = new TestCase( SECTION, "\\9", "9", "\9" ); + + array[item++] = new TestCase( SECTION, "\\A", "A", "\A" ); + array[item++] = new TestCase( SECTION, "\\B", "B", "\B" ); + array[item++] = new TestCase( SECTION, "\\C", "C", "\C" ); + array[item++] = new TestCase( SECTION, "\\D", "D", "\D" ); + array[item++] = new TestCase( SECTION, "\\E", "E", "\E" ); + array[item++] = new TestCase( SECTION, "\\F", "F", "\F" ); + array[item++] = new TestCase( SECTION, "\\G", "G", "\G" ); + array[item++] = new TestCase( SECTION, "\\H", "H", "\H" ); + array[item++] = new TestCase( SECTION, "\\I", "I", "\I" ); + array[item++] = new TestCase( SECTION, "\\J", "J", "\J" ); + array[item++] = new TestCase( SECTION, "\\K", "K", "\K" ); + array[item++] = new TestCase( SECTION, "\\L", "L", "\L" ); + array[item++] = new TestCase( SECTION, "\\M", "M", "\M" ); + array[item++] = new TestCase( SECTION, "\\N", "N", "\N" ); + array[item++] = new TestCase( SECTION, "\\O", "O", "\O" ); + array[item++] = new TestCase( SECTION, "\\P", "P", "\P" ); + array[item++] = new TestCase( SECTION, "\\Q", "Q", "\Q" ); + array[item++] = new TestCase( SECTION, "\\R", "R", "\R" ); + array[item++] = new TestCase( SECTION, "\\S", "S", "\S" ); + array[item++] = new TestCase( SECTION, "\\T", "T", "\T" ); + array[item++] = new TestCase( SECTION, "\\U", "U", "\U" ); + array[item++] = new TestCase( SECTION, "\\V", "V", "\V" ); + array[item++] = new TestCase( SECTION, "\\W", "W", "\W" ); + array[item++] = new TestCase( SECTION, "\\X", "X", "\X" ); + array[item++] = new TestCase( SECTION, "\\Y", "Y", "\Y" ); + array[item++] = new TestCase( SECTION, "\\Z", "Z", "\Z" ); + + // DoubleStringCharacter::EscapeSequence::UnicodeEscapeSequence + + array[item++] = new TestCase( SECTION, "\\u0020", " ", "\u0020" ); + array[item++] = new TestCase( SECTION, "\\u0021", "!", "\u0021" ); + array[item++] = new TestCase( SECTION, "\\u0022", "\"", "\u0022" ); + array[item++] = new TestCase( SECTION, "\\u0023", "#", "\u0023" ); + array[item++] = new TestCase( SECTION, "\\u0024", "$", "\u0024" ); + array[item++] = new TestCase( SECTION, "\\u0025", "%", "\u0025" ); + array[item++] = new TestCase( SECTION, "\\u0026", "&", "\u0026" ); + array[item++] = new TestCase( SECTION, "\\u0027", "'", "\u0027" ); + array[item++] = new TestCase( SECTION, "\\u0028", "(", "\u0028" ); + array[item++] = new TestCase( SECTION, "\\u0029", ")", "\u0029" ); + array[item++] = new TestCase( SECTION, "\\u002A", "*", "\u002A" ); + array[item++] = new TestCase( SECTION, "\\u002B", "+", "\u002B" ); + array[item++] = new TestCase( SECTION, "\\u002C", ",", "\u002C" ); + array[item++] = new TestCase( SECTION, "\\u002D", "-", "\u002D" ); + array[item++] = new TestCase( SECTION, "\\u002E", ".", "\u002E" ); + array[item++] = new TestCase( SECTION, "\\u002F", "/", "\u002F" ); + array[item++] = new TestCase( SECTION, "\\u0030", "0", "\u0030" ); + array[item++] = new TestCase( SECTION, "\\u0031", "1", "\u0031" ); + array[item++] = new TestCase( SECTION, "\\u0032", "2", "\u0032" ); + array[item++] = new TestCase( SECTION, "\\u0033", "3", "\u0033" ); + array[item++] = new TestCase( SECTION, "\\u0034", "4", "\u0034" ); + array[item++] = new TestCase( SECTION, "\\u0035", "5", "\u0035" ); + array[item++] = new TestCase( SECTION, "\\u0036", "6", "\u0036" ); + array[item++] = new TestCase( SECTION, "\\u0037", "7", "\u0037" ); + array[item++] = new TestCase( SECTION, "\\u0038", "8", "\u0038" ); + array[item++] = new TestCase( SECTION, "\\u0039", "9", "\u0039" ); + + + return ( array ); +} + +function test() { + for ( tc=0; tc < testcases.length; tc++ ) { + testcases[tc].actual = testcases[tc].actual; + + testcases[tc].passed = writeTestCaseResult( + testcases[tc].expect, + testcases[tc].actual, + testcases[tc].description +" = "+ testcases[tc].actual ); + + testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; + } + + stopTest(); + return ( testcases ); +} diff --git a/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.8.2-n.js b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.8.2-n.js new file mode 100644 index 0000000..82bd7c4 --- /dev/null +++ b/JavaScriptCore/tests/mozilla/ecma/LexicalConventions/7.8.2-n.js @@ -0,0 +1,48 @@ +/* The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released March + * 31, 1998. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + */ +/** + File Name: 7.8.2.js + ECMA Section: 7.8.2 Examples of Automatic Semicolon Insertion + Description: compare some specific examples of the automatic + insertion rules in the EMCA specification. + Author: christine@netscape.com + Date: 15 september 1997 +*/ + + var SECTION="7.8.2"; + var VERSION="ECMA_1" + startTest(); + writeHeaderToLog(SECTION+" "+"Examples of Semicolon Insertion"); + + testcases = getTestCases(); + test(); + +function getTestCases() { + var array = new Array(); + var item = 0; + +// array[item++] = new TestCase( "7.8.2", "{ 1 \n 2 } 3", 3, "{ 1 \n 2 } 3" ); + array[item++] = new TestCase( "7.8.2", "{ 1 2 } 3", "error", eval("{1 2 } 3") ); + + return ( array ); +} + |