src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeDate.java

Print this page

        

*** 119,128 **** --- 119,132 ---- this.time = time; this.timezone = env._timezone; } + NativeDate(final double time, final ScriptObject proto) { + this(time, proto, $nasgenmap$); + } + NativeDate(final double time, final Global global) { this(time, global.getDatePrototype(), $nasgenmap$); } private NativeDate (final double time) {
*** 1274,1284 **** private static NativeDate getNativeDate(final Object self) { if (self instanceof NativeDate) { return (NativeDate)self; } else if (self != null && self == Global.instance().getDatePrototype()) { ! return Global.instance().DEFAULT_DATE; } else { throw typeError("not.a.date", ScriptRuntime.safeToString(self)); } } --- 1278,1288 ---- private static NativeDate getNativeDate(final Object self) { if (self instanceof NativeDate) { return (NativeDate)self; } else if (self != null && self == Global.instance().getDatePrototype()) { ! return Global.instance().getDefaultDate(); } else { throw typeError("not.a.date", ScriptRuntime.safeToString(self)); } }