diff options
author | Andre Fischer <af@apache.org> | 2011-12-23 08:25:48 +0000 |
---|---|---|
committer | Andre Fischer <af@apache.org> | 2011-12-23 08:25:48 +0000 |
commit | 3109a6eef3f78b65a71d693efdd6fb3e471548cb (patch) | |
tree | bf7c603ee8be263396a350a31b900ed763b9004a /scripting | |
parent | 62c9b62b380b158dfa39547684c2ad23e5b98018 (diff) |
118623: Update of rhino from 1.5R5 to 1.7R3.
Author: Tsutomu Uchino
Diffstat (limited to 'scripting')
2 files changed, 11 insertions, 2 deletions
diff --git a/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptEditorForJavaScript.java b/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptEditorForJavaScript.java index 8abfc485b976..c461db5edfd6 100644 --- a/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptEditorForJavaScript.java +++ b/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptEditorForJavaScript.java @@ -261,6 +261,11 @@ public class ScriptEditorForJavaScript implements ScriptEditor } final Main sdb = new Main("Rhino JavaScript Debugger"); + org.mozilla.javascript.tools.shell.ShellContextFactory contextFactory = + new org.mozilla.javascript.tools.shell.ShellContextFactory(); + sdb.attachTo(contextFactory); + contextFactory.setLanguageVersion(Context.VERSION_1_8); + contextFactory.setOptimizationLevel(9); sdb.pack(); sdb.setSize(640, 640); sdb.setVisible(true); @@ -271,12 +276,14 @@ public class ScriptEditorForJavaScript implements ScriptEditor shutdown(); } }); + /* Context.addContextListener(sdb); sdb.setScopeProvider(new ScopeProvider() { public Scriptable getScope() { return org.mozilla.javascript.tools.shell.Main.getScope(); } }); + */ sdb.addWindowListener( new WindowAdapter() { public void windowClosing(WindowEvent e) { shutdown(); diff --git a/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptProviderForJavaScript.java b/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptProviderForJavaScript.java index fc6f787c8acb..cfb09770fba9 100755 --- a/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptProviderForJavaScript.java +++ b/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptProviderForJavaScript.java @@ -264,6 +264,8 @@ class ScriptImpl implements XScript // Initialize a Rhino Context object ctxt = Context.enter(); + ctxt.setLanguageVersion(Context.VERSION_1_8); + ctxt.setOptimizationLevel(9); /* The ImporterTopLevel ensures that importClass and importPackage statements work in Javascript scripts @@ -289,14 +291,14 @@ class ScriptImpl implements XScript catch (JavaScriptException jse) { LogUtils.DEBUG( "Caught JavaScriptException exception for JavaScript type = " + jse.getClass() ); String message = jse.getMessage(); - //int lineNo = jse.getLineNumber(); + int lineNo = jse.lineNumber(); Object wrap = jse.getValue(); LogUtils.DEBUG( "\t message " + message ); LogUtils.DEBUG( "\t wrapped type " + wrap.getClass() ); LogUtils.DEBUG( "\t wrapped toString " + wrap.toString() ); ScriptExceptionRaisedException se = new ScriptExceptionRaisedException( message ); - se.lineNum = -1; + se.lineNum = lineNo; se.language = "JavaScript"; se.scriptName = metaData.getLanguageName(); se.exceptionType = wrap.getClass().getName(); |