|
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
2 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
5 |
|
6 |
|
7 /** |
|
8 File Name: script-001.js |
|
9 Section: |
|
10 Description: new NativeScript object |
|
11 |
|
12 |
|
13 js> parseInt(123,"hi") |
|
14 123 |
|
15 js> parseInt(123, "blah") |
|
16 123 |
|
17 js> s |
|
18 js: s is not defined |
|
19 js> s = new Script |
|
20 |
|
21 undefined; |
|
22 |
|
23 |
|
24 js> s = new Script() |
|
25 |
|
26 undefined; |
|
27 |
|
28 |
|
29 js> s.getJSClass |
|
30 js> s.getJSClass = Object.prototype.toString |
|
31 function toString() { |
|
32 [native code] |
|
33 } |
|
34 |
|
35 js> s.getJSClass() |
|
36 [object Script] |
|
37 js> s.compile( "return 3+4" ) |
|
38 js: JavaScript exception: javax.javascript.EvaluatorException: "<Scr |
|
39 js> s.compile( "3+4" ) |
|
40 |
|
41 3 + 4; |
|
42 |
|
43 |
|
44 js> typeof s |
|
45 function |
|
46 js> s() |
|
47 Jit failure! |
|
48 invalid opcode: 1 |
|
49 Jit Pass1 Failure! |
|
50 javax/javascript/gen/c13 initScript (Ljavax/javascript/Scriptable;)V |
|
51 An internal JIT error has occurred. Please report this with .class |
|
52 jit-bugs@itools.symantec.com |
|
53 |
|
54 7 |
|
55 js> s.compile("3+4") |
|
56 |
|
57 3 + 4; |
|
58 |
|
59 |
|
60 js> s() |
|
61 Jit failure! |
|
62 invalid opcode: 1 |
|
63 Jit Pass1 Failure! |
|
64 javax/javascript/gen/c17 initScript (Ljavax/javascript/Scriptable;)V |
|
65 An internal JIT error has occurred. Please report this with .class |
|
66 jit-bugs@itools.symantec.com |
|
67 |
|
68 7 |
|
69 js> quit() |
|
70 |
|
71 C:\src\ns_priv\js\tests\ecma>shell |
|
72 |
|
73 C:\src\ns_priv\js\tests\ecma>java -classpath c:\cafe\java\JavaScope; |
|
74 :\src\ns_priv\js\tests javax.javascript.examples.Shell |
|
75 Symantec Java! JustInTime Compiler Version 210.054 for JDK 1.1.2 |
|
76 Copyright (C) 1996-97 Symantec Corporation |
|
77 |
|
78 js> s = new Script("3+4") |
|
79 |
|
80 3 + 4; |
|
81 |
|
82 |
|
83 js> s() |
|
84 7 |
|
85 js> s2 = new Script(); |
|
86 |
|
87 undefined; |
|
88 |
|
89 |
|
90 js> s.compile( "3+4") |
|
91 |
|
92 3 + 4; |
|
93 |
|
94 |
|
95 js> s() |
|
96 Jit failure! |
|
97 invalid opcode: 1 |
|
98 Jit Pass1 Failure! |
|
99 javax/javascript/gen/c7 initScript (Ljavax/javascript/Scriptable;)V |
|
100 An internal JIT error has occurred. Please report this with .class |
|
101 jit-bugs@itools.symantec.com |
|
102 |
|
103 7 |
|
104 js> quit() |
|
105 Author: christine@netscape.com |
|
106 Date: 12 november 1997 |
|
107 */ |
|
108 |
|
109 var SECTION = "script-001"; |
|
110 var VERSION = "JS1_3"; |
|
111 var TITLE = "NativeScript"; |
|
112 |
|
113 startTest(); |
|
114 writeHeaderToLog( SECTION + " "+ TITLE); |
|
115 |
|
116 if (typeof Script == 'undefined') |
|
117 { |
|
118 print('Test skipped. Script not defined.'); |
|
119 new TestCase( SECTION, |
|
120 "var s = new Script(); typeof s", |
|
121 "Script not supported, test skipped.", |
|
122 "Script not supported, test skipped." ); |
|
123 } |
|
124 else |
|
125 { |
|
126 var s = new Script(); |
|
127 s.getJSClass = Object.prototype.toString; |
|
128 |
|
129 new TestCase( SECTION, |
|
130 "var s = new Script(); typeof s", |
|
131 "function", |
|
132 typeof s ); |
|
133 |
|
134 new TestCase( SECTION, |
|
135 "s.getJSClass()", |
|
136 "[object Script]", |
|
137 s.getJSClass() ); |
|
138 } |
|
139 |
|
140 test(); |