]>
git.saurik.com Git - apple/javascriptcore.git/blob - tests/mozilla/js1_3/Script/script-001.js
1 /* The contents of this file are subject to the Netscape Public
2 * License Version 1.1 (the "License"); you may not use this file
3 * except in compliance with the License. You may obtain a copy of
4 * the License at http://www.mozilla.org/NPL/
6 * Software distributed under the License is distributed on an "AS
7 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
8 * implied. See the License for the specific language governing
9 * rights and limitations under the License.
11 * The Original Code is Mozilla Communicator client code, released March
14 * The Initial Developer of the Original Code is Netscape Communications
15 * Corporation. Portions created by Netscape are
16 * Copyright (C) 1998 Netscape Communications Corporation. All
23 File Name: script-001.js
25 Description: new NativeScript object
28 js> parseInt(123,"hi")
30 js> parseInt(123, "blah")
45 js> s.getJSClass = Object.prototype.toString
52 js> s.compile( "return 3+4" )
53 js: JavaScript exception: javax.javascript.EvaluatorException: "<Scr
54 js> s.compile( "3+4" )
65 javax/javascript/gen/c13 initScript (Ljavax/javascript/Scriptable;)V
66 An internal JIT error has occurred. Please report this with .class
67 jit-bugs@itools.symantec.com
79 javax/javascript/gen/c17 initScript (Ljavax/javascript/Scriptable;)V
80 An internal JIT error has occurred. Please report this with .class
81 jit-bugs@itools.symantec.com
86 C:\src\ns_priv\js\tests\ecma>shell
88 C:\src\ns_priv\js\tests\ecma>java -classpath c:\cafe\java\JavaScope;
89 :\src\ns_priv\js\tests javax.javascript.examples.Shell
90 Symantec Java! JustInTime Compiler Version 210.054 for JDK 1.1.2
91 Copyright (C) 1996-97 Symantec Corporation
93 js> s = new Script("3+4")
100 js> s2 = new Script();
105 js> s.compile( "3+4")
114 javax/javascript/gen/c7 initScript (Ljavax/javascript/Scriptable;)V
115 An internal JIT error has occurred. Please report this with .class
116 jit-bugs@itools.symantec.com
120 Author: christine@netscape.com
121 Date: 12 november 1997
124 var SECTION
= "script-001";
125 var VERSION
= "JS1_3";
126 var TITLE
= "NativeScript";
129 writeHeaderToLog( SECTION
+ " "+ TITLE
);
131 var testcases
= new Array();
133 var s
= new Script();
134 s
.getJSClass
= Object
.prototype.toString
;
136 testcases
[tc
++] = new TestCase( SECTION
,
137 "var s = new Script(); typeof s",
141 testcases
[tc
++] = new TestCase( SECTION
,
148 for ( tc
=0; tc
< testcases
.length
; tc
++ ) {
149 testcases
[tc
].passed
= writeTestCaseResult(
150 testcases
[tc
].expect
,
151 testcases
[tc
].actual
,
152 testcases
[tc
].description
+" = "+
153 testcases
[tc
].actual
);
155 testcases
[tc
].reason
+= ( testcases
[tc
].passed
) ? "" : "wrong value ";
158 return ( testcases
);