aboutsummaryrefslogtreecommitdiff
path: root/src/jdk/nashorn/api/scripting/NashornException.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/jdk/nashorn/api/scripting/NashornException.java')
-rw-r--r--src/jdk/nashorn/api/scripting/NashornException.java17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/jdk/nashorn/api/scripting/NashornException.java b/src/jdk/nashorn/api/scripting/NashornException.java
index a5f8c24a..098f8508 100644
--- a/src/jdk/nashorn/api/scripting/NashornException.java
+++ b/src/jdk/nashorn/api/scripting/NashornException.java
@@ -53,9 +53,6 @@ public abstract class NashornException extends RuntimeException {
// underlying ECMA error object - lazily initialized
private Object ecmaError;
- /** script source name used for "engine.js" */
- public static final String ENGINE_SCRIPT_SOURCE_NAME = "nashorn:engine/resources/engine.js";
-
/**
* Constructor
*
@@ -182,7 +179,7 @@ public abstract class NashornException extends RuntimeException {
if (ECMAErrors.isScriptFrame(st)) {
final String className = "<" + st.getFileName() + ">";
String methodName = st.getMethodName();
- if (methodName.equals(CompilerConstants.RUN_SCRIPT.symbolName())) {
+ if (methodName.equals(CompilerConstants.PROGRAM.symbolName())) {
methodName = "<program>";
}
@@ -224,10 +221,22 @@ public abstract class NashornException extends RuntimeException {
return buf.toString();
}
+ /**
+ * Get the thrown object. Subclass responsibility
+ * @return thrown object
+ */
protected Object getThrown() {
return null;
}
+ /**
+ * Initialization function for ECMA errors. Stores the error
+ * in the ecmaError field of this class. It is only initialized
+ * once, and then reused
+ *
+ * @param global the global
+ * @return initialized exception
+ */
protected NashornException initEcmaError(final ScriptObject global) {
if (ecmaError != null) {
return this; // initialized already!