summaryrefslogtreecommitdiffstats
path: root/JavaScriptCore/tests/mozilla/js1_3/Script
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2011-05-06 11:45:16 +0100
committerSteve Block <steveblock@google.com>2011-05-12 13:44:10 +0100
commitcad810f21b803229eb11403f9209855525a25d57 (patch)
tree29a6fd0279be608e0fe9ffe9841f722f0f4e4269 /JavaScriptCore/tests/mozilla/js1_3/Script
parent121b0cf4517156d0ac5111caf9830c51b69bae8f (diff)
downloadexternal_webkit-cad810f21b803229eb11403f9209855525a25d57.zip
external_webkit-cad810f21b803229eb11403f9209855525a25d57.tar.gz
external_webkit-cad810f21b803229eb11403f9209855525a25d57.tar.bz2
Merge WebKit at r75315: Initial merge by git.
Change-Id: I570314b346ce101c935ed22a626b48c2af266b84
Diffstat (limited to 'JavaScriptCore/tests/mozilla/js1_3/Script')
-rw-r--r--JavaScriptCore/tests/mozilla/js1_3/Script/delete-001.js79
-rw-r--r--JavaScriptCore/tests/mozilla/js1_3/Script/function-001-n.js74
-rw-r--r--JavaScriptCore/tests/mozilla/js1_3/Script/function-002.js75
-rw-r--r--JavaScriptCore/tests/mozilla/js1_3/Script/in-001.js52
-rw-r--r--JavaScriptCore/tests/mozilla/js1_3/Script/new-001.js120
-rw-r--r--JavaScriptCore/tests/mozilla/js1_3/Script/script-001.js159
-rw-r--r--JavaScriptCore/tests/mozilla/js1_3/Script/switch-001.js80
7 files changed, 0 insertions, 639 deletions
diff --git a/JavaScriptCore/tests/mozilla/js1_3/Script/delete-001.js b/JavaScriptCore/tests/mozilla/js1_3/Script/delete-001.js
deleted file mode 100644
index e2f4332..0000000
--- a/JavaScriptCore/tests/mozilla/js1_3/Script/delete-001.js
+++ /dev/null
@@ -1,79 +0,0 @@
-/* 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: delete-001.js
- Section: regress
- Description:
-
- Regression test for
- http://scopus.mcom.com/bugsplat/show_bug.cgi?id=108736
-
- Author: christine@netscape.com
- Date: 12 november 1997
-*/
-
- var SECTION = "JS1_2";
- var VERSION = "JS1_2";
- var TITLE = "The variable statment";
-
- startTest();
- writeHeaderToLog( SECTION + " "+ TITLE);
-
- var testcases = new Array();
-
- // delete all properties of the global object
- // per ecma, this does not affect variables in the global object declared
- // with var or functions
-
- for ( p in this ) {
- delete p;
- }
-
- var result ="";
-
- for ( p in this ) {
- result += String( p );
- }
-
- // not too picky here... just want to make sure we didn't crash or something
-
- testcases[testcases.length] = new TestCase( SECTION,
- "delete all properties of the global object",
- "PASSED",
- result == "" ? "FAILED" : "PASSED" );
-
-
- 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/js1_3/Script/function-001-n.js b/JavaScriptCore/tests/mozilla/js1_3/Script/function-001-n.js
deleted file mode 100644
index 5b4add0..0000000
--- a/JavaScriptCore/tests/mozilla/js1_3/Script/function-001-n.js
+++ /dev/null
@@ -1,74 +0,0 @@
-/* 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: boolean-001.js
- * Description:
- *
- * http://scopus.mcom.com/bugsplat/show_bug.cgi?id=99232
- *
- * eval("function f(){}function g(){}") at top level is an error for JS1.2
- * and above (missing ; between named function expressions), but declares f
- * and g as functions below 1.2.
- *
- * Fails to produce error regardless of version:
- * js> version(100)
- * 120
- * js> eval("function f(){}function g(){}")
- * js> version(120);
- * 100
- * js> eval("function f(){}function g(){}")
- * js>
- * Author: christine@netscape.com
- * Date: 11 August 1998
- */
- var SECTION = "function-001.js";
- var VERSION = "JS_1.3";
- var TITLE = "functions not separated by semicolons are errors in version 120 and higher";
- var BUGNUMBER="10278";
-
- startTest();
- writeHeaderToLog( SECTION + " "+ TITLE);
-
- var testcases = new Array();
-
- testcases[tc++] = new TestCase(
- SECTION,
- "eval(\"function f(){}function g(){}\")",
- "error",
- eval("function f(){}function g(){}") );
-
- 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/js1_3/Script/function-002.js b/JavaScriptCore/tests/mozilla/js1_3/Script/function-002.js
deleted file mode 100644
index d3d1d85..0000000
--- a/JavaScriptCore/tests/mozilla/js1_3/Script/function-002.js
+++ /dev/null
@@ -1,75 +0,0 @@
-/* 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: function-002.js
- Section:
- Description:
-
- http://scopus.mcom.com/bugsplat/show_bug.cgi?id=249579
-
- function definitions in conditional statements should be allowed.
-
- Author: christine@netscape.com
- Date: 12 november 1997
-*/
- var SECTION = "function-002";
- var VERSION = "JS1_3";
- var TITLE = "Regression test for 249579";
- var BUGNUMBER="249579";
-
- startTest();
- writeHeaderToLog( SECTION + " "+ TITLE);
-
- var testcases = new Array();
-
- testcases[tc++] = new TestCase(
- SECTION,
- "0?function(){}:0",
- 0,
- 0?function(){}:0 );
-
-
- bar = true;
- foo = bar ? function () { return true; } : function() { return false; };
-
- testcases[tc++] = new TestCase(
- SECTION,
- "bar = true; foo = bar ? function () { return true; } : function() { return false; }; foo()",
- true,
- foo() );
-
-
- 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/js1_3/Script/in-001.js b/JavaScriptCore/tests/mozilla/js1_3/Script/in-001.js
deleted file mode 100644
index d9d76fe..0000000
--- a/JavaScriptCore/tests/mozilla/js1_3/Script/in-001.js
+++ /dev/null
@@ -1,52 +0,0 @@
-/* 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: in-001.js
- Section:
- Description:
-
- http://scopus.mcom.com/bugsplat/show_bug.cgi?id=196109
-
-
- Author: christine@netscape.com
- Date: 12 november 1997
-*/
- var SECTION = "in-001";
- var VERSION = "JS1_3";
- var TITLE = "Regression test for 196109";
- var BUGNUMBER="196109";
-
- startTest();
- writeHeaderToLog( SECTION + " "+ TITLE);
-
- var testcases = new Array();
-
- o = {};
- o.foo = 'sil';
-
- testcases[tc++] = new TestCase(
- SECTION,
- "\"foo\" in o",
- true,
- "foo" in o );
-
- test();
diff --git a/JavaScriptCore/tests/mozilla/js1_3/Script/new-001.js b/JavaScriptCore/tests/mozilla/js1_3/Script/new-001.js
deleted file mode 100644
index 2868eca..0000000
--- a/JavaScriptCore/tests/mozilla/js1_3/Script/new-001.js
+++ /dev/null
@@ -1,120 +0,0 @@
-/* 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: new-001.js
- Section:
- Description:
-
- http://scopus.mcom.com/bugsplat/show_bug.cgi?id=76103
-
- Author: christine@netscape.com
- Date: 12 november 1997
-*/
- var SECTION = "new-001";
- var VERSION = "JS1_3";
- var TITLE = "new-001";
- var BUGNUMBER="31567";
-
- startTest();
- writeHeaderToLog( SECTION + " "+ TITLE);
-
- var testcases = new Array();
-
- function Test_One (x) {
- this.v = x+1;
- return x*2
- }
-
- function Test_Two( x, y ) {
- this.v = x;
- return y;
- }
-
- testcases[tc++] = new TestCase(
- SECTION,
- "Test_One(18)",
- 36,
- Test_One(18) );
-
- testcases[tc++] = new TestCase(
- SECTION,
- "new Test_One(18)",
- "[object Object]",
- new Test_One(18) +"" );
-
- testcases[tc++] = new TestCase(
- SECTION,
- "new Test_One(18).v",
- 19,
- new Test_One(18).v );
-
- testcases[tc++] = new TestCase(
- SECTION,
- "Test_Two(2,7)",
- 7,
- Test_Two(2,7) );
-
- testcases[tc++] = new TestCase(
- SECTION,
- "new Test_Two(2,7)",
- "[object Object]",
- new Test_Two(2,7) +"" );
-
- testcases[tc++] = new TestCase(
- SECTION,
- "new Test_Two(2,7).v",
- 2,
- new Test_Two(2,7).v );
-
- testcases[tc++] = new TestCase(
- SECTION,
- "new (Function)(\"x\", \"return x+3\")(5,6)",
- 8,
- new (Function)("x","return x+3")(5,6) );
-
- testcases[tc++] = new TestCase(
- SECTION,
- "new new Test_Two(String, 2).v(0123)",
- "83",
- new new Test_Two(String, 2).v(0123) +"");
-
- testcases[tc++] = new TestCase(
- SECTION,
- "new new Test_Two(String, 2).v(0123).length",
- 2,
- new new Test_Two(String, 2).v(0123).length );
-
- 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/js1_3/Script/script-001.js b/JavaScriptCore/tests/mozilla/js1_3/Script/script-001.js
deleted file mode 100644
index 5e7ec89..0000000
--- a/JavaScriptCore/tests/mozilla/js1_3/Script/script-001.js
+++ /dev/null
@@ -1,159 +0,0 @@
-/* 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: script-001.js
- Section:
- Description: new NativeScript object
-
-
-js> parseInt(123,"hi")
-123
-js> parseInt(123, "blah")
-123
-js> s
-js: s is not defined
-js> s = new Script
-
-undefined;
-
-
-js> s = new Script()
-
-undefined;
-
-
-js> s.getJSClass
-js> s.getJSClass = Object.prototype.toString
-function toString() {
- [native code]
-}
-
-js> s.getJSClass()
-[object Script]
-js> s.compile( "return 3+4" )
-js: JavaScript exception: javax.javascript.EvaluatorException: "<Scr
-js> s.compile( "3+4" )
-
-3 + 4;
-
-
-js> typeof s
-function
-js> s()
-Jit failure!
-invalid opcode: 1
-Jit Pass1 Failure!
-javax/javascript/gen/c13 initScript (Ljavax/javascript/Scriptable;)V
-An internal JIT error has occurred. Please report this with .class
-jit-bugs@itools.symantec.com
-
-7
-js> s.compile("3+4")
-
-3 + 4;
-
-
-js> s()
-Jit failure!
-invalid opcode: 1
-Jit Pass1 Failure!
-javax/javascript/gen/c17 initScript (Ljavax/javascript/Scriptable;)V
-An internal JIT error has occurred. Please report this with .class
-jit-bugs@itools.symantec.com
-
-7
-js> quit()
-
-C:\src\ns_priv\js\tests\ecma>shell
-
-C:\src\ns_priv\js\tests\ecma>java -classpath c:\cafe\java\JavaScope;
-:\src\ns_priv\js\tests javax.javascript.examples.Shell
-Symantec Java! JustInTime Compiler Version 210.054 for JDK 1.1.2
-Copyright (C) 1996-97 Symantec Corporation
-
-js> s = new Script("3+4")
-
-3 + 4;
-
-
-js> s()
-7
-js> s2 = new Script();
-
-undefined;
-
-
-js> s.compile( "3+4")
-
-3 + 4;
-
-
-js> s()
-Jit failure!
-invalid opcode: 1
-Jit Pass1 Failure!
-javax/javascript/gen/c7 initScript (Ljavax/javascript/Scriptable;)V
-An internal JIT error has occurred. Please report this with .class
-jit-bugs@itools.symantec.com
-
-7
-js> quit()
- Author: christine@netscape.com
- Date: 12 november 1997
-*/
-
- var SECTION = "script-001";
- var VERSION = "JS1_3";
- var TITLE = "NativeScript";
-
- startTest();
- writeHeaderToLog( SECTION + " "+ TITLE);
-
- var testcases = new Array();
-
- var s = new Script();
- s.getJSClass = Object.prototype.toString;
-
- testcases[tc++] = new TestCase( SECTION,
- "var s = new Script(); typeof s",
- "function",
- typeof s );
-
- testcases[tc++] = new TestCase( SECTION,
- "s.getJSClass()",
- "[object Script]",
- s.getJSClass() );
-
- 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/js1_3/Script/switch-001.js b/JavaScriptCore/tests/mozilla/js1_3/Script/switch-001.js
deleted file mode 100644
index b3f71d7..0000000
--- a/JavaScriptCore/tests/mozilla/js1_3/Script/switch-001.js
+++ /dev/null
@@ -1,80 +0,0 @@
-/* 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: switch-001.js
- Section:
- Description:
-
- http://scopus.mcom.com/bugsplat/show_bug.cgi?id=315767
-
- Verify that switches do not use strict equality in
- versions of JavaScript < 1.4
-
- Author: christine@netscape.com
- Date: 12 november 1997
-*/
- var SECTION = "switch-001";
- var VERSION = "JS1_3";
- var TITLE = "switch-001";
- var BUGNUMBER="315767";
-
- startTest();
- writeHeaderToLog( SECTION + " "+ TITLE);
-
- var testcases = new Array();
-
- result = "fail: did not enter switch";
-
- switch (true) {
- case 1:
- result = "fail: for backwards compatibility, version 130 use strict equality";
- break;
- case true:
- result = "pass";
- break;
- default:
- result = "fail: evaluated default statement";
- }
-
- testcases[tc++] = new TestCase(
- SECTION,
- "switch / case should use strict equality in version of JS < 1.4",
- "pass",
- result );
-
-
-
- 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 );
-}