mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 20:05:49 +00:00
Fix ecma_2/Exceptions/exception-006.js
This commit is contained in:
parent
589bd0d760
commit
db8bea4b84
@ -60,11 +60,13 @@ public class NativeError extends ScriptableObject {
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return ScriptRuntime.toString(ScriptRuntime.getProp(this, "name", this));
|
||||
return ScriptRuntime.toString(
|
||||
ScriptRuntime.getProp(this, "name", this));
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return ScriptRuntime.toString(ScriptRuntime.getProp(this, "message", this));
|
||||
return ScriptRuntime.toString(
|
||||
ScriptRuntime.getProp(this, "message", this));
|
||||
}
|
||||
|
||||
public static void finishInit(Scriptable scope, FunctionObject ctor,
|
||||
@ -72,9 +74,9 @@ public class NativeError extends ScriptableObject {
|
||||
throws PropertyException
|
||||
{
|
||||
((ScriptableObject) proto).defineProperty("message", "",
|
||||
ScriptableObject.EMPTY);
|
||||
ScriptableObject.EMPTY);
|
||||
((ScriptableObject) proto).defineProperty("name", "Error",
|
||||
ScriptableObject.EMPTY);
|
||||
ScriptableObject.EMPTY);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -587,8 +587,10 @@ public abstract class ScriptableObject implements Scriptable {
|
||||
}
|
||||
Object arg = typeHint == null ? "undefined" : typeHint.toString();
|
||||
Object[] args = { arg };
|
||||
throw Context.reportRuntimeError(Context.getMessage
|
||||
("msg.default.value", args));
|
||||
throw NativeGlobal.constructError(
|
||||
Context.getContext(), "TypeError",
|
||||
ScriptRuntime.getMessage("msg.default.value", args),
|
||||
this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -60,11 +60,13 @@ public class NativeError extends ScriptableObject {
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return ScriptRuntime.toString(ScriptRuntime.getProp(this, "name", this));
|
||||
return ScriptRuntime.toString(
|
||||
ScriptRuntime.getProp(this, "name", this));
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return ScriptRuntime.toString(ScriptRuntime.getProp(this, "message", this));
|
||||
return ScriptRuntime.toString(
|
||||
ScriptRuntime.getProp(this, "message", this));
|
||||
}
|
||||
|
||||
public static void finishInit(Scriptable scope, FunctionObject ctor,
|
||||
@ -72,9 +74,9 @@ public class NativeError extends ScriptableObject {
|
||||
throws PropertyException
|
||||
{
|
||||
((ScriptableObject) proto).defineProperty("message", "",
|
||||
ScriptableObject.EMPTY);
|
||||
ScriptableObject.EMPTY);
|
||||
((ScriptableObject) proto).defineProperty("name", "Error",
|
||||
ScriptableObject.EMPTY);
|
||||
ScriptableObject.EMPTY);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -587,8 +587,10 @@ public abstract class ScriptableObject implements Scriptable {
|
||||
}
|
||||
Object arg = typeHint == null ? "undefined" : typeHint.toString();
|
||||
Object[] args = { arg };
|
||||
throw Context.reportRuntimeError(Context.getMessage
|
||||
("msg.default.value", args));
|
||||
throw NativeGlobal.constructError(
|
||||
Context.getContext(), "TypeError",
|
||||
ScriptRuntime.getMessage("msg.default.value", args),
|
||||
this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user