src/jdk/nashorn/internal/objects/NativeSyntaxError.java

Print this page
rev 747 : 8031983: Error objects should capture stack at the constructor
Reviewed-by: jlaskey, hannesw
rev 748 : 8032004: instance property "message" of Error objects should be non-enumerable
Reviewed-by: hannesw, jlaskey
rev 749 : 8032060: PropertyMap of Error objects is not stable
Reviewed-by: jlaskey, hannesw
rev 755 : 8035948: Redesign property listeners for shared classes
Reviewed-by: sundar, lagergren
rev 760 : 8037400: Remove getInitialMap getters and GlobalObject interface
Reviewed-by: lagergren, jlaskey, attila

*** 42,76 **** */ @ScriptClass("Error") public final class NativeSyntaxError extends ScriptObject { /** message property in instance */ ! @Property(name = NativeError.MESSAGE) public Object instMessage; /** error name property */ @Property(attributes = Attribute.NOT_ENUMERABLE, where = Where.PROTOTYPE) public Object name; /** ECMA 15.1.1.1 message property */ @Property(attributes = Attribute.NOT_ENUMERABLE, where = Where.PROTOTYPE) public Object message; // initialized by nasgen private static PropertyMap $nasgenmap$; ! static PropertyMap getInitialMap() { ! return $nasgenmap$; ! } ! NativeSyntaxError(final Object msg, final Global global) { ! super(global.getSyntaxErrorPrototype(), global.getSyntaxErrorMap()); if (msg != UNDEFINED) { this.instMessage = JSType.toString(msg); } else { this.delete(NativeError.MESSAGE, false); } } private NativeSyntaxError(final Object msg) { this(msg, Global.instance()); } --- 42,78 ---- */ @ScriptClass("Error") public final class NativeSyntaxError extends ScriptObject { /** message property in instance */ ! @Property(name = NativeError.MESSAGE, attributes = Attribute.NOT_ENUMERABLE) public Object instMessage; /** error name property */ @Property(attributes = Attribute.NOT_ENUMERABLE, where = Where.PROTOTYPE) public Object name; /** ECMA 15.1.1.1 message property */ @Property(attributes = Attribute.NOT_ENUMERABLE, where = Where.PROTOTYPE) public Object message; + /** Nashorn extension: underlying exception */ + @Property(attributes = Attribute.NOT_ENUMERABLE) + public Object nashornException; + // initialized by nasgen private static PropertyMap $nasgenmap$; ! @SuppressWarnings("LeakingThisInConstructor") NativeSyntaxError(final Object msg, final Global global) { ! super(global.getSyntaxErrorPrototype(), $nasgenmap$); if (msg != UNDEFINED) { this.instMessage = JSType.toString(msg); } else { this.delete(NativeError.MESSAGE, false); } + NativeError.initException(this); } private NativeSyntaxError(final Object msg) { this(msg, Global.instance()); }