michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: michael@0: /** michael@0: File Name: script-001.js michael@0: Section: michael@0: Description: new NativeScript object michael@0: michael@0: michael@0: js> parseInt(123,"hi") michael@0: 123 michael@0: js> parseInt(123, "blah") michael@0: 123 michael@0: js> s michael@0: js: s is not defined michael@0: js> s = new Script michael@0: michael@0: undefined; michael@0: michael@0: michael@0: js> s = new Script() michael@0: michael@0: undefined; michael@0: michael@0: michael@0: js> s.getJSClass michael@0: js> s.getJSClass = Object.prototype.toString michael@0: function toString() { michael@0: [native code] michael@0: } michael@0: michael@0: js> s.getJSClass() michael@0: [object Script] michael@0: js> s.compile( "return 3+4" ) michael@0: js: JavaScript exception: javax.javascript.EvaluatorException: " s.compile( "3+4" ) michael@0: michael@0: 3 + 4; michael@0: michael@0: michael@0: js> typeof s michael@0: function michael@0: js> s() michael@0: Jit failure! michael@0: invalid opcode: 1 michael@0: Jit Pass1 Failure! michael@0: javax/javascript/gen/c13 initScript (Ljavax/javascript/Scriptable;)V michael@0: An internal JIT error has occurred. Please report this with .class michael@0: jit-bugs@itools.symantec.com michael@0: michael@0: 7 michael@0: js> s.compile("3+4") michael@0: michael@0: 3 + 4; michael@0: michael@0: michael@0: js> s() michael@0: Jit failure! michael@0: invalid opcode: 1 michael@0: Jit Pass1 Failure! michael@0: javax/javascript/gen/c17 initScript (Ljavax/javascript/Scriptable;)V michael@0: An internal JIT error has occurred. Please report this with .class michael@0: jit-bugs@itools.symantec.com michael@0: michael@0: 7 michael@0: js> quit() michael@0: michael@0: C:\src\ns_priv\js\tests\ecma>shell michael@0: michael@0: C:\src\ns_priv\js\tests\ecma>java -classpath c:\cafe\java\JavaScope; michael@0: :\src\ns_priv\js\tests javax.javascript.examples.Shell michael@0: Symantec Java! JustInTime Compiler Version 210.054 for JDK 1.1.2 michael@0: Copyright (C) 1996-97 Symantec Corporation michael@0: michael@0: js> s = new Script("3+4") michael@0: michael@0: 3 + 4; michael@0: michael@0: michael@0: js> s() michael@0: 7 michael@0: js> s2 = new Script(); michael@0: michael@0: undefined; michael@0: michael@0: michael@0: js> s.compile( "3+4") michael@0: michael@0: 3 + 4; michael@0: michael@0: michael@0: js> s() michael@0: Jit failure! michael@0: invalid opcode: 1 michael@0: Jit Pass1 Failure! michael@0: javax/javascript/gen/c7 initScript (Ljavax/javascript/Scriptable;)V michael@0: An internal JIT error has occurred. Please report this with .class michael@0: jit-bugs@itools.symantec.com michael@0: michael@0: 7 michael@0: js> quit() michael@0: Author: christine@netscape.com michael@0: Date: 12 november 1997 michael@0: */ michael@0: michael@0: var SECTION = "script-001"; michael@0: var VERSION = "JS1_3"; michael@0: var TITLE = "NativeScript"; michael@0: michael@0: startTest(); michael@0: writeHeaderToLog( SECTION + " "+ TITLE); michael@0: michael@0: if (typeof Script == 'undefined') michael@0: { michael@0: print('Test skipped. Script not defined.'); michael@0: new TestCase( SECTION, michael@0: "var s = new Script(); typeof s", michael@0: "Script not supported, test skipped.", michael@0: "Script not supported, test skipped." ); michael@0: } michael@0: else michael@0: { michael@0: var s = new Script(); michael@0: s.getJSClass = Object.prototype.toString; michael@0: michael@0: new TestCase( SECTION, michael@0: "var s = new Script(); typeof s", michael@0: "function", michael@0: typeof s ); michael@0: michael@0: new TestCase( SECTION, michael@0: "s.getJSClass()", michael@0: "[object Script]", michael@0: s.getJSClass() ); michael@0: } michael@0: michael@0: test();