43 import jdk.nashorn.internal.objects.annotations.Function; |
43 import jdk.nashorn.internal.objects.annotations.Function; |
44 import jdk.nashorn.internal.objects.annotations.Property; |
44 import jdk.nashorn.internal.objects.annotations.Property; |
45 import jdk.nashorn.internal.objects.annotations.ScriptClass; |
45 import jdk.nashorn.internal.objects.annotations.ScriptClass; |
46 import jdk.nashorn.internal.objects.annotations.Where; |
46 import jdk.nashorn.internal.objects.annotations.Where; |
47 import jdk.nashorn.internal.runtime.JSType; |
47 import jdk.nashorn.internal.runtime.JSType; |
|
48 import jdk.nashorn.internal.runtime.PropertyMap; |
48 import jdk.nashorn.internal.runtime.ScriptObject; |
49 import jdk.nashorn.internal.runtime.ScriptObject; |
49 import jdk.nashorn.internal.runtime.ScriptRuntime; |
50 import jdk.nashorn.internal.runtime.ScriptRuntime; |
50 import jdk.nashorn.internal.lookup.MethodHandleFactory; |
51 import jdk.nashorn.internal.lookup.MethodHandleFactory; |
51 import jdk.nashorn.internal.runtime.linker.PrimitiveLookup; |
52 import jdk.nashorn.internal.runtime.linker.PrimitiveLookup; |
52 |
53 |
81 |
82 |
82 private final double value; |
83 private final double value; |
83 private final boolean isInt; |
84 private final boolean isInt; |
84 private final boolean isLong; |
85 private final boolean isLong; |
85 |
86 |
|
87 // initialized by nasgen |
|
88 private static PropertyMap $nasgenmap$; |
|
89 |
86 NativeNumber(final double value) { |
90 NativeNumber(final double value) { |
87 this(value, Global.instance().getNumberPrototype()); |
91 this(value, Global.instance().getNumberPrototype()); |
88 } |
92 } |
89 |
93 |
90 private NativeNumber(final double value, final ScriptObject proto) { |
94 private NativeNumber(final double value, final ScriptObject proto) { |
|
95 super(proto, $nasgenmap$); |
91 this.value = value; |
96 this.value = value; |
92 this.isInt = isRepresentableAsInt(value); |
97 this.isInt = isRepresentableAsInt(value); |
93 this.isLong = isRepresentableAsLong(value); |
98 this.isLong = isRepresentableAsLong(value); |
94 this.setProto(proto); |
|
95 } |
99 } |
96 |
100 |
97 @Override |
101 @Override |
98 public String safeToString() { |
102 public String safeToString() { |
99 return "[Number " + toString() + "]"; |
103 return "[Number " + toString() + "]"; |