Cosmetic: Add macros for NaN, undefined and Infinity to native js code.
Nobody should need to use $NaN, 0/0, 1/0 and void 0. R=mvstanton@chromium.org BUG= Review URL: https://codereview.chromium.org/27491002 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17252 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
f8cc87a095
commit
8ef4b0ca83
@ -36,9 +36,9 @@ var ARRAY_ITERATOR_KIND_VALUES = 2;
|
||||
var ARRAY_ITERATOR_KIND_ENTRIES = 3;
|
||||
// The spec draft also has "sparse" but it is never used.
|
||||
|
||||
var iteratorObjectSymbol = %CreateSymbol(void 0);
|
||||
var arrayIteratorNextIndexSymbol = %CreateSymbol(void 0);
|
||||
var arrayIterationKindSymbol = %CreateSymbol(void 0);
|
||||
var iteratorObjectSymbol = %CreateSymbol(UNDEFINED);
|
||||
var arrayIteratorNextIndexSymbol = %CreateSymbol(UNDEFINED);
|
||||
var arrayIterationKindSymbol = %CreateSymbol(UNDEFINED);
|
||||
|
||||
function ArrayIterator() {}
|
||||
|
||||
@ -74,7 +74,7 @@ function ArrayIteratorNext() {
|
||||
|
||||
if (index >= length) {
|
||||
iterator[arrayIteratorNextIndexSymbol] = 1 / 0; // Infinity
|
||||
return CreateIteratorResultObject(void 0, true);
|
||||
return CreateIteratorResultObject(UNDEFINED, true);
|
||||
}
|
||||
|
||||
iterator[arrayIteratorNextIndexSymbol] = index + 1;
|
||||
|
12
src/array.js
12
src/array.js
@ -677,7 +677,7 @@ function ArraySlice(start, end) {
|
||||
var start_i = TO_INTEGER(start);
|
||||
var end_i = len;
|
||||
|
||||
if (end !== void 0) end_i = TO_INTEGER(end);
|
||||
if (!IS_UNDEFINED(end)) end_i = TO_INTEGER(end);
|
||||
|
||||
if (start_i < 0) {
|
||||
start_i += len;
|
||||
@ -1016,7 +1016,7 @@ function ArraySort(comparefn) {
|
||||
var proto_length = indices;
|
||||
for (var i = from; i < proto_length; i++) {
|
||||
if (proto.hasOwnProperty(i)) {
|
||||
obj[i] = void 0;
|
||||
obj[i] = UNDEFINED;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@ -1024,7 +1024,7 @@ function ArraySort(comparefn) {
|
||||
var index = indices[i];
|
||||
if (!IS_UNDEFINED(index) && from <= index &&
|
||||
proto.hasOwnProperty(index)) {
|
||||
obj[index] = void 0;
|
||||
obj[index] = UNDEFINED;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1061,7 +1061,7 @@ function ArraySort(comparefn) {
|
||||
if (first_undefined < last_defined) {
|
||||
// Fill in hole or undefined.
|
||||
obj[first_undefined] = obj[last_defined];
|
||||
obj[last_defined] = void 0;
|
||||
obj[last_defined] = UNDEFINED;
|
||||
}
|
||||
}
|
||||
// If there were any undefineds in the entire array, first_undefined
|
||||
@ -1073,12 +1073,12 @@ function ArraySort(comparefn) {
|
||||
// an undefined should be and vice versa.
|
||||
var i;
|
||||
for (i = first_undefined; i < length - num_holes; i++) {
|
||||
obj[i] = void 0;
|
||||
obj[i] = UNDEFINED;
|
||||
}
|
||||
for (i = length - num_holes; i < length; i++) {
|
||||
// For compatability with Webkit, do not expose elements in the prototype.
|
||||
if (i in %GetPrototype(obj)) {
|
||||
obj[i] = void 0;
|
||||
obj[i] = UNDEFINED;
|
||||
} else {
|
||||
delete obj[i];
|
||||
}
|
||||
|
14
src/d8.js
14
src/d8.js
@ -40,7 +40,7 @@ function log10(num) {
|
||||
|
||||
function ToInspectableObject(obj) {
|
||||
if (!obj && typeof obj === 'object') {
|
||||
return void 0;
|
||||
return UNDEFINED;
|
||||
} else {
|
||||
return Object(obj);
|
||||
}
|
||||
@ -333,7 +333,7 @@ function DebugRequest(cmd_line) {
|
||||
}
|
||||
|
||||
if ((cmd === undefined) || !cmd) {
|
||||
this.request_ = void 0;
|
||||
this.request_ = UNDEFINED;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -492,7 +492,7 @@ function DebugRequest(cmd_line) {
|
||||
case 'trace':
|
||||
case 'tr':
|
||||
// Return undefined to indicate command handled internally (no JSON).
|
||||
this.request_ = void 0;
|
||||
this.request_ = UNDEFINED;
|
||||
this.traceCommand_(args);
|
||||
break;
|
||||
|
||||
@ -500,7 +500,7 @@ function DebugRequest(cmd_line) {
|
||||
case '?':
|
||||
this.helpCommand_(args);
|
||||
// Return undefined to indicate command handled internally (no JSON).
|
||||
this.request_ = void 0;
|
||||
this.request_ = UNDEFINED;
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -2124,7 +2124,7 @@ function SimpleObjectToJSON_(object) {
|
||||
var property_value_json;
|
||||
switch (typeof property_value) {
|
||||
case 'object':
|
||||
if (property_value === null) {
|
||||
if (IS_NULL(property_value)) {
|
||||
property_value_json = 'null';
|
||||
} else if (typeof property_value.toJSONProtocol == 'function') {
|
||||
property_value_json = property_value.toJSONProtocol(true);
|
||||
@ -2217,7 +2217,7 @@ function Stringify(x, depth) {
|
||||
case "symbol":
|
||||
return "Symbol(" + (x.name ? Stringify(x.name, depth) : "") + ")"
|
||||
case "object":
|
||||
if (x === null) return "null";
|
||||
if (IS_NULL(x)) return "null";
|
||||
if (x.constructor && x.constructor.name === "Array") {
|
||||
var elems = [];
|
||||
for (var i = 0; i < x.length; ++i) {
|
||||
@ -2233,7 +2233,7 @@ function Stringify(x, depth) {
|
||||
var props = [];
|
||||
for (var name in x) {
|
||||
var desc = Object.getOwnPropertyDescriptor(x, name);
|
||||
if (desc === void 0) continue;
|
||||
if (IS_UNDEFINED(desc)) continue;
|
||||
if ("value" in desc) {
|
||||
props.push(name + ": " + Stringify(desc.value, depth - 1));
|
||||
}
|
||||
|
32
src/date.js
32
src/date.js
@ -41,7 +41,7 @@ function ThrowDateTypeError() {
|
||||
}
|
||||
|
||||
|
||||
var timezone_cache_time = $NaN;
|
||||
var timezone_cache_time = NAN;
|
||||
var timezone_cache_timezone;
|
||||
|
||||
function LocalTimezone(t) {
|
||||
@ -66,10 +66,10 @@ function UTC(time) {
|
||||
|
||||
// ECMA 262 - 15.9.1.11
|
||||
function MakeTime(hour, min, sec, ms) {
|
||||
if (!$isFinite(hour)) return $NaN;
|
||||
if (!$isFinite(min)) return $NaN;
|
||||
if (!$isFinite(sec)) return $NaN;
|
||||
if (!$isFinite(ms)) return $NaN;
|
||||
if (!$isFinite(hour)) return NAN;
|
||||
if (!$isFinite(min)) return NAN;
|
||||
if (!$isFinite(sec)) return NAN;
|
||||
if (!$isFinite(ms)) return NAN;
|
||||
return TO_INTEGER(hour) * msPerHour
|
||||
+ TO_INTEGER(min) * msPerMinute
|
||||
+ TO_INTEGER(sec) * msPerSecond
|
||||
@ -90,7 +90,7 @@ function TimeInYear(year) {
|
||||
// MakeDay(2007, -33, 1) --> MakeDay(2004, 3, 1)
|
||||
// MakeDay(2007, 14, -50) --> MakeDay(2007, 8, 11)
|
||||
function MakeDay(year, month, date) {
|
||||
if (!$isFinite(year) || !$isFinite(month) || !$isFinite(date)) return $NaN;
|
||||
if (!$isFinite(year) || !$isFinite(month) || !$isFinite(date)) return NAN;
|
||||
|
||||
// Convert to integer and map -0 to 0.
|
||||
year = TO_INTEGER_MAP_MINUS_ZERO(year);
|
||||
@ -99,7 +99,7 @@ function MakeDay(year, month, date) {
|
||||
|
||||
if (year < kMinYear || year > kMaxYear ||
|
||||
month < kMinMonth || month > kMaxMonth) {
|
||||
return $NaN;
|
||||
return NAN;
|
||||
}
|
||||
|
||||
// Now we rely on year and month being SMIs.
|
||||
@ -115,15 +115,15 @@ function MakeDate(day, time) {
|
||||
// is no way that the time can be within range even after UTC
|
||||
// conversion we return NaN immediately instead of relying on
|
||||
// TimeClip to do it.
|
||||
if ($abs(time) > MAX_TIME_BEFORE_UTC) return $NaN;
|
||||
if ($abs(time) > MAX_TIME_BEFORE_UTC) return NAN;
|
||||
return time;
|
||||
}
|
||||
|
||||
|
||||
// ECMA 262 - 15.9.1.14
|
||||
function TimeClip(time) {
|
||||
if (!$isFinite(time)) return $NaN;
|
||||
if ($abs(time) > MAX_TIME_MS) return $NaN;
|
||||
if (!$isFinite(time)) return NAN;
|
||||
if ($abs(time) > MAX_TIME_MS) return NAN;
|
||||
return TO_INTEGER(time);
|
||||
}
|
||||
|
||||
@ -132,7 +132,7 @@ function TimeClip(time) {
|
||||
// strings over and over again.
|
||||
var Date_cache = {
|
||||
// Cached time value.
|
||||
time: $NaN,
|
||||
time: NAN,
|
||||
// String input for which the cached time is valid.
|
||||
string: null
|
||||
};
|
||||
@ -269,7 +269,7 @@ var parse_buffer = $Array(8);
|
||||
// ECMA 262 - 15.9.4.2
|
||||
function DateParse(string) {
|
||||
var arr = %DateParseString(ToString(string), parse_buffer);
|
||||
if (IS_NULL(arr)) return $NaN;
|
||||
if (IS_NULL(arr)) return NAN;
|
||||
|
||||
var day = MakeDay(arr[0], arr[1], arr[2]);
|
||||
var time = MakeTime(arr[3], arr[4], arr[5], arr[6]);
|
||||
@ -671,7 +671,7 @@ function DateGetYear() {
|
||||
function DateSetYear(year) {
|
||||
CHECK_DATE(this);
|
||||
year = ToNumber(year);
|
||||
if (NUMBER_IS_NAN(year)) return SET_UTC_DATE_VALUE(this, $NaN);
|
||||
if (NUMBER_IS_NAN(year)) return SET_UTC_DATE_VALUE(this, NAN);
|
||||
year = (0 <= TO_INTEGER(year) && TO_INTEGER(year) <= 99)
|
||||
? 1900 + TO_INTEGER(year) : year;
|
||||
var t = LOCAL_DATE_VALUE(this);
|
||||
@ -746,12 +746,12 @@ function DateToJSON(key) {
|
||||
|
||||
function ResetDateCache() {
|
||||
// Reset the timezone cache:
|
||||
timezone_cache_time = $NaN;
|
||||
timezone_cache_time = NAN;
|
||||
timezone_cache_timezone = undefined;
|
||||
|
||||
// Reset the date cache:
|
||||
cache = Date_cache;
|
||||
cache.time = $NaN;
|
||||
cache.time = NAN;
|
||||
cache.string = null;
|
||||
}
|
||||
|
||||
@ -762,7 +762,7 @@ function SetUpDate() {
|
||||
%CheckIsBootstrapping();
|
||||
|
||||
%SetCode($Date, DateConstructor);
|
||||
%FunctionSetPrototype($Date, new $Date($NaN));
|
||||
%FunctionSetPrototype($Date, new $Date(NAN));
|
||||
|
||||
// Set up non-enumerable properties of the Date object itself.
|
||||
InstallFunctions($Date, DONT_ENUM, $Array(
|
||||
|
@ -448,7 +448,7 @@ ScriptBreakPoint.prototype.set = function (script) {
|
||||
|
||||
// If the position is not found in the script (the script might be shorter
|
||||
// than it used to be) just ignore it.
|
||||
if (position === null) return;
|
||||
if (IS_NULL(position)) return;
|
||||
|
||||
// Create a break point object and set the break point.
|
||||
break_point = MakeBreakPoint(position, this);
|
||||
@ -2064,7 +2064,7 @@ DebugCommandProcessor.resolveValue_ = function(value_description) {
|
||||
} else if ("value" in value_description) {
|
||||
return value_description.value;
|
||||
} else if (value_description.type == UNDEFINED_TYPE) {
|
||||
return void 0;
|
||||
return UNDEFINED;
|
||||
} else if (value_description.type == NULL_TYPE) {
|
||||
return null;
|
||||
} else {
|
||||
|
16
src/i18n.js
16
src/i18n.js
@ -290,7 +290,7 @@ function addBoundMethod(obj, methodName, implementation, length) {
|
||||
* Parameter locales is treated as a priority list.
|
||||
*/
|
||||
function supportedLocalesOf(service, locales, options) {
|
||||
if (service.match(GetServiceRE()) === null) {
|
||||
if (IS_NULL(service.match(GetServiceRE()))) {
|
||||
throw new $Error('Internal error, wrong service type: ' + service);
|
||||
}
|
||||
|
||||
@ -447,7 +447,7 @@ function resolveLocale(service, requestedLocales, options) {
|
||||
* lookup algorithm.
|
||||
*/
|
||||
function lookupMatcher(service, requestedLocales) {
|
||||
if (service.match(GetServiceRE()) === null) {
|
||||
if (IS_NULL(service.match(GetServiceRE()))) {
|
||||
throw new $Error('Internal error, wrong service type: ' + service);
|
||||
}
|
||||
|
||||
@ -463,7 +463,7 @@ function lookupMatcher(service, requestedLocales) {
|
||||
if (AVAILABLE_LOCALES[service][locale] !== undefined) {
|
||||
// Return the resolved locale and extension.
|
||||
var extensionMatch = requestedLocales[i].match(GetUnicodeExtensionRE());
|
||||
var extension = (extensionMatch === null) ? '' : extensionMatch[0];
|
||||
var extension = IS_NULL(extensionMatch) ? '' : extensionMatch[0];
|
||||
return {'locale': locale, 'extension': extension, 'position': i};
|
||||
}
|
||||
// Truncate locale if possible.
|
||||
@ -535,7 +535,7 @@ function parseExtension(extension) {
|
||||
* Converts parameter to an Object if possible.
|
||||
*/
|
||||
function toObject(value) {
|
||||
if (value === undefined || value === null) {
|
||||
if (IS_NULL_OR_UNDEFINED(value)) {
|
||||
throw new $TypeError('Value cannot be converted to an Object.');
|
||||
}
|
||||
|
||||
@ -733,7 +733,7 @@ function toTitleCaseWord(word) {
|
||||
function canonicalizeLanguageTag(localeID) {
|
||||
// null is typeof 'object' so we have to do extra check.
|
||||
if (typeof localeID !== 'string' && typeof localeID !== 'object' ||
|
||||
localeID === null) {
|
||||
IS_NULL(localeID)) {
|
||||
throw new $TypeError('Language ID should be string or object.');
|
||||
}
|
||||
|
||||
@ -1449,7 +1449,7 @@ function fromLDMLString(ldmlString) {
|
||||
|
||||
|
||||
function appendToDateTimeObject(options, option, match, pairs) {
|
||||
if (match === null) {
|
||||
if (IS_NULL(match)) {
|
||||
if (!options.hasOwnProperty(option)) {
|
||||
defineWEProperty(options, option, undefined);
|
||||
}
|
||||
@ -1751,7 +1751,7 @@ function canonicalizeTimeZoneID(tzID) {
|
||||
// We expect only _ and / beside ASCII letters.
|
||||
// All inputs should conform to Area/Location from now on.
|
||||
var match = GetTimezoneNameCheckRE().exec(tzID);
|
||||
if (match === null) {
|
||||
if (IS_NULL(match)) {
|
||||
throw new $RangeError('Expected Area/Location for time zone, got ' + tzID);
|
||||
}
|
||||
|
||||
@ -1971,7 +1971,7 @@ $Object.defineProperty($String.prototype, 'localeCompare', {
|
||||
throw new $TypeError(ORDINARY_FUNCTION_CALLED_AS_CONSTRUCTOR);
|
||||
}
|
||||
|
||||
if (this === undefined || this === null) {
|
||||
if (IS_NULL_OR_UNDEFINED(this)) {
|
||||
throw new $TypeError('Method invoked on undefined or null value.');
|
||||
}
|
||||
|
||||
|
@ -181,7 +181,7 @@ function JSONSerialize(key, holder, replacer, stack, indent, gap) {
|
||||
}
|
||||
}
|
||||
// Undefined or a callable object.
|
||||
return void 0;
|
||||
return UNDEFINED;
|
||||
}
|
||||
|
||||
|
||||
@ -236,5 +236,5 @@ function JSONSerializeAdapter(key, object) {
|
||||
var holder = {};
|
||||
holder[key] = object;
|
||||
// No need to pass the actual holder since there is no replacer function.
|
||||
return JSONSerialize(key, holder, void 0, new InternalArray(), "", "");
|
||||
return JSONSerialize(key, holder, UNDEFINED, new InternalArray(), "", "");
|
||||
}
|
||||
|
@ -186,7 +186,7 @@ Debug.LiveEdit = new function() {
|
||||
// to old version.
|
||||
if (link_to_old_script_list.length == 0) {
|
||||
%LiveEditReplaceScript(script, new_source, null);
|
||||
old_script = void 0;
|
||||
old_script = UNDEFINED;
|
||||
} else {
|
||||
var old_script_name = CreateNameForOldScript(script);
|
||||
|
||||
@ -266,7 +266,7 @@ Debug.LiveEdit = new function() {
|
||||
// LiveEdit itself believe that any function in heap that points to a
|
||||
// particular script is a regular function.
|
||||
// For some functions we will restore this link later.
|
||||
%LiveEditFunctionSetScript(info.shared_function_info, void 0);
|
||||
%LiveEditFunctionSetScript(info.shared_function_info, UNDEFINED);
|
||||
compile_info.push(info);
|
||||
old_index_map.push(i);
|
||||
}
|
||||
@ -542,16 +542,16 @@ Debug.LiveEdit = new function() {
|
||||
this.children = children;
|
||||
// an index in array of compile_info
|
||||
this.array_index = array_index;
|
||||
this.parent = void 0;
|
||||
this.parent = UNDEFINED;
|
||||
|
||||
this.status = FunctionStatus.UNCHANGED;
|
||||
// Status explanation is used for debugging purposes and will be shown
|
||||
// in user UI if some explanations are needed.
|
||||
this.status_explanation = void 0;
|
||||
this.new_start_pos = void 0;
|
||||
this.new_end_pos = void 0;
|
||||
this.corresponding_node = void 0;
|
||||
this.unmatched_new_nodes = void 0;
|
||||
this.status_explanation = UNDEFINED;
|
||||
this.new_start_pos = UNDEFINED;
|
||||
this.new_end_pos = UNDEFINED;
|
||||
this.corresponding_node = UNDEFINED;
|
||||
this.unmatched_new_nodes = UNDEFINED;
|
||||
|
||||
// 'Textual' correspondence/matching is weaker than 'pure'
|
||||
// correspondence/matching. We need 'textual' level for visual presentation
|
||||
@ -559,10 +559,10 @@ Debug.LiveEdit = new function() {
|
||||
// Sometimes only function body is changed (functions in old and new script
|
||||
// textually correspond), but we cannot patch the code, so we see them
|
||||
// as an old function deleted and new function created.
|
||||
this.textual_corresponding_node = void 0;
|
||||
this.textually_unmatched_new_nodes = void 0;
|
||||
this.textual_corresponding_node = UNDEFINED;
|
||||
this.textually_unmatched_new_nodes = UNDEFINED;
|
||||
|
||||
this.live_shared_function_infos = void 0;
|
||||
this.live_shared_function_infos = UNDEFINED;
|
||||
}
|
||||
|
||||
// From array of function infos that is implicitly a tree creates
|
||||
@ -740,7 +740,7 @@ Debug.LiveEdit = new function() {
|
||||
old_children[old_index].status_explanation =
|
||||
"Enclosing function is now incompatible. " +
|
||||
scope_change_description;
|
||||
old_children[old_index].corresponding_node = void 0;
|
||||
old_children[old_index].corresponding_node = UNDEFINED;
|
||||
} else if (old_children[old_index].status !=
|
||||
FunctionStatus.UNCHANGED) {
|
||||
ProcessNode(old_children[old_index],
|
||||
@ -748,7 +748,7 @@ Debug.LiveEdit = new function() {
|
||||
if (old_children[old_index].status == FunctionStatus.DAMAGED) {
|
||||
unmatched_new_nodes_list.push(
|
||||
old_children[old_index].corresponding_node);
|
||||
old_children[old_index].corresponding_node = void 0;
|
||||
old_children[old_index].corresponding_node = UNDEFINED;
|
||||
old_node.status = FunctionStatus.CHANGED;
|
||||
}
|
||||
}
|
||||
|
@ -157,6 +157,11 @@ macro TO_NUMBER_INLINE(arg) = (IS_NUMBER(%IS_VAR(arg)) ? arg : NonNumberToNumber
|
||||
macro TO_OBJECT_INLINE(arg) = (IS_SPEC_OBJECT(%IS_VAR(arg)) ? arg : ToObject(arg));
|
||||
macro JSON_NUMBER_TO_STRING(arg) = ((%_IsSmi(%IS_VAR(arg)) || arg - arg == 0) ? %_NumberToString(arg) : "null");
|
||||
|
||||
# Constants. The compiler constant folds them.
|
||||
const NAN = $NaN;
|
||||
const INFINITY = (1/0);
|
||||
const UNDEFINED = (void 0);
|
||||
|
||||
# Macros implemented in Python.
|
||||
python macro CHAR_CODE(str) = ord(str[1]);
|
||||
|
||||
|
@ -131,9 +131,9 @@ function MathMax(arg1, arg2) { // length == 2
|
||||
return (arg1 == 0 && !%_IsSmi(arg1) && 1 / arg1 < 0) ? arg2 : arg1;
|
||||
}
|
||||
// All comparisons failed, one of the arguments must be NaN.
|
||||
return 0/0; // Compiler constant-folds this to NaN.
|
||||
return NAN;
|
||||
}
|
||||
var r = -1/0; // Compiler constant-folds this to -Infinity.
|
||||
var r = -INFINITY;
|
||||
for (var i = 0; i < length; i++) {
|
||||
var n = %_Arguments(i);
|
||||
if (!IS_NUMBER(n)) n = NonNumberToNumber(n);
|
||||
@ -161,9 +161,9 @@ function MathMin(arg1, arg2) { // length == 2
|
||||
return (arg1 == 0 && !%_IsSmi(arg1) && 1 / arg1 < 0) ? arg1 : arg2;
|
||||
}
|
||||
// All comparisons failed, one of the arguments must be NaN.
|
||||
return 0/0; // Compiler constant-folds this to NaN.
|
||||
return NAN;
|
||||
}
|
||||
var r = 1/0; // Compiler constant-folds this to Infinity.
|
||||
var r = INFINITY;
|
||||
for (var i = 0; i < length; i++) {
|
||||
var n = %_Arguments(i);
|
||||
if (!IS_NUMBER(n)) n = NonNumberToNumber(n);
|
||||
|
@ -796,7 +796,7 @@ function CallSite(receiver, fun, pos, strict_mode) {
|
||||
}
|
||||
|
||||
function CallSiteGetThis() {
|
||||
return this[CallSiteStrictModeKey] ? void 0 : this[CallSiteReceiverKey];
|
||||
return this[CallSiteStrictModeKey] ? UNDEFINED : this[CallSiteReceiverKey];
|
||||
}
|
||||
|
||||
function CallSiteGetTypeName() {
|
||||
@ -826,7 +826,7 @@ function CallSiteGetScriptNameOrSourceURL() {
|
||||
}
|
||||
|
||||
function CallSiteGetFunction() {
|
||||
return this[CallSiteStrictModeKey] ? void 0 : this[CallSiteFunctionKey];
|
||||
return this[CallSiteStrictModeKey] ? UNDEFINED : this[CallSiteFunctionKey];
|
||||
}
|
||||
|
||||
function CallSiteGetFunctionName() {
|
||||
@ -1092,7 +1092,7 @@ function FormatStackTrace(obj, error_string, frames) {
|
||||
var array = [];
|
||||
%MoveArrayContents(frames, array);
|
||||
formatting_custom_stack_trace = true;
|
||||
var stack_trace = void 0;
|
||||
var stack_trace = UNDEFINED;
|
||||
try {
|
||||
stack_trace = $Error.prepareStackTrace(obj, array);
|
||||
} catch (e) {
|
||||
@ -1160,7 +1160,7 @@ function captureStackTrace(obj, cons_opt) {
|
||||
// Turn this accessor into a data property.
|
||||
%DefineOrRedefineDataProperty(obj, 'stack', result, NONE);
|
||||
// Release context values.
|
||||
stack = error_string = void 0;
|
||||
stack = error_string = UNDEFINED;
|
||||
return result;
|
||||
};
|
||||
|
||||
@ -1171,7 +1171,7 @@ function captureStackTrace(obj, cons_opt) {
|
||||
%DefineOrRedefineDataProperty(this, 'stack', v, NONE);
|
||||
if (this === obj) {
|
||||
// Release context values if holder is the same as the receiver.
|
||||
stack = error_string = void 0;
|
||||
stack = error_string = UNDEFINED;
|
||||
}
|
||||
};
|
||||
|
||||
@ -1213,7 +1213,7 @@ function SetUpError() {
|
||||
// Define all the expected properties directly on the error
|
||||
// object. This avoids going through getters and setters defined
|
||||
// on prototype objects.
|
||||
%IgnoreAttributesAndSetProperty(this, 'stack', void 0, DONT_ENUM);
|
||||
%IgnoreAttributesAndSetProperty(this, 'stack', UNDEFINED, DONT_ENUM);
|
||||
if (!IS_UNDEFINED(m)) {
|
||||
%IgnoreAttributesAndSetProperty(
|
||||
this, 'message', ToString(m), DONT_ENUM);
|
||||
@ -1251,7 +1251,7 @@ function GetPropertyWithoutInvokingMonkeyGetters(error, name) {
|
||||
while (error && !%HasLocalProperty(error, name)) {
|
||||
error = %GetPrototype(error);
|
||||
}
|
||||
if (error === null) return void 0;
|
||||
if (IS_NULL(error)) return UNDEFINED;
|
||||
if (!IS_OBJECT(error)) return error[name];
|
||||
// If the property is an accessor on one of the predefined errors that can be
|
||||
// generated statically by the compiler, don't touch it. This is to address
|
||||
@ -1260,11 +1260,11 @@ function GetPropertyWithoutInvokingMonkeyGetters(error, name) {
|
||||
if (desc && desc[IS_ACCESSOR_INDEX]) {
|
||||
var isName = name === "name";
|
||||
if (error === $ReferenceError.prototype)
|
||||
return isName ? "ReferenceError" : void 0;
|
||||
return isName ? "ReferenceError" : UNDEFINED;
|
||||
if (error === $SyntaxError.prototype)
|
||||
return isName ? "SyntaxError" : void 0;
|
||||
return isName ? "SyntaxError" : UNDEFINED;
|
||||
if (error === $TypeError.prototype)
|
||||
return isName ? "TypeError" : void 0;
|
||||
return isName ? "TypeError" : UNDEFINED;
|
||||
}
|
||||
// Otherwise, read normally.
|
||||
return error[name];
|
||||
|
@ -117,7 +117,7 @@ function LookupMirror(handle) {
|
||||
* @returns {Mirror} the mirror reflects the undefined value
|
||||
*/
|
||||
function GetUndefinedMirror() {
|
||||
return MakeMirror(void 0);
|
||||
return MakeMirror(UNDEFINED);
|
||||
}
|
||||
|
||||
|
||||
@ -482,7 +482,7 @@ ValueMirror.prototype.value = function() {
|
||||
* @extends ValueMirror
|
||||
*/
|
||||
function UndefinedMirror() {
|
||||
%_CallFunction(this, UNDEFINED_TYPE, void 0, ValueMirror);
|
||||
%_CallFunction(this, UNDEFINED_TYPE, UNDEFINED, ValueMirror);
|
||||
}
|
||||
inherits(UndefinedMirror, ValueMirror);
|
||||
|
||||
@ -957,7 +957,7 @@ FunctionMirror.prototype.scopeCount = function() {
|
||||
|
||||
FunctionMirror.prototype.scope = function(index) {
|
||||
if (this.resolved()) {
|
||||
return new ScopeMirror(void 0, this, index);
|
||||
return new ScopeMirror(UNDEFINED, this, index);
|
||||
}
|
||||
};
|
||||
|
||||
@ -1670,7 +1670,7 @@ FrameMirror.prototype.scopeCount = function() {
|
||||
|
||||
|
||||
FrameMirror.prototype.scope = function(index) {
|
||||
return new ScopeMirror(this, void 0, index);
|
||||
return new ScopeMirror(this, UNDEFINED, index);
|
||||
};
|
||||
|
||||
|
||||
|
@ -72,12 +72,12 @@ function ObservationWeakMap(map) {
|
||||
ObservationWeakMap.prototype = {
|
||||
get: function(key) {
|
||||
key = %UnwrapGlobalProxy(key);
|
||||
if (!IS_SPEC_OBJECT(key)) return void 0;
|
||||
if (!IS_SPEC_OBJECT(key)) return UNDEFINED;
|
||||
return %WeakCollectionGet(this.map_, key);
|
||||
},
|
||||
set: function(key, value) {
|
||||
key = %UnwrapGlobalProxy(key);
|
||||
if (!IS_SPEC_OBJECT(key)) return void 0;
|
||||
if (!IS_SPEC_OBJECT(key)) return UNDEFINED;
|
||||
%WeakCollectionSet(this.map_, key, value);
|
||||
},
|
||||
has: function(key) {
|
||||
@ -492,7 +492,7 @@ function ObjectNotifierPerformChange(changeType, changeFn) {
|
||||
|
||||
ObjectInfoAddPerformingType(objectInfo, changeType);
|
||||
try {
|
||||
%_CallFunction(void 0, changeFn);
|
||||
%_CallFunction(UNDEFINED, changeFn);
|
||||
} finally {
|
||||
ObjectInfoRemovePerformingType(objectInfo, changeType);
|
||||
}
|
||||
@ -525,7 +525,7 @@ function CallbackDeliverPending(callback) {
|
||||
%MoveArrayContents(callbackInfo, delivered);
|
||||
|
||||
try {
|
||||
%_CallFunction(void 0, delivered, callback);
|
||||
%_CallFunction(UNDEFINED, delivered, callback);
|
||||
} catch (ex) {}
|
||||
return true;
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ function ProxyCreate(handler, proto) {
|
||||
throw MakeTypeError("handler_non_object", ["create"])
|
||||
if (IS_UNDEFINED(proto))
|
||||
proto = null
|
||||
else if (!(IS_SPEC_OBJECT(proto) || proto === null))
|
||||
else if (!(IS_SPEC_OBJECT(proto) || IS_NULL(proto)))
|
||||
throw MakeTypeError("proto_non_object", ["create"])
|
||||
return %CreateJSProxy(handler, proto)
|
||||
}
|
||||
@ -56,7 +56,7 @@ function ProxyCreateFunction(handler, callTrap, constructTrap) {
|
||||
// Make sure the trap receives 'undefined' as this.
|
||||
var construct = constructTrap
|
||||
constructTrap = function() {
|
||||
return %Apply(construct, void 0, arguments, 0, %_ArgumentsLength());
|
||||
return %Apply(construct, UNDEFINED, arguments, 0, %_ArgumentsLength());
|
||||
}
|
||||
} else {
|
||||
throw MakeTypeError("trap_function_expected",
|
||||
|
@ -189,7 +189,7 @@ function RegExpExec(string) {
|
||||
// matchIndices is either null or the lastMatchInfo array.
|
||||
var matchIndices = %_RegExpExec(this, string, i, lastMatchInfo);
|
||||
|
||||
if (matchIndices === null) {
|
||||
if (IS_NULL(matchIndices)) {
|
||||
this.lastIndex = 0;
|
||||
return null;
|
||||
}
|
||||
@ -232,7 +232,7 @@ function RegExpTest(string) {
|
||||
%_Log('regexp', 'regexp-exec,%0r,%1S,%2i', [this, string, lastIndex]);
|
||||
// matchIndices is either null or the lastMatchInfo array.
|
||||
var matchIndices = %_RegExpExec(this, string, i, lastMatchInfo);
|
||||
if (matchIndices === null) {
|
||||
if (IS_NULL(matchIndices)) {
|
||||
this.lastIndex = 0;
|
||||
return false;
|
||||
}
|
||||
@ -253,7 +253,7 @@ function RegExpTest(string) {
|
||||
%_Log('regexp', 'regexp-exec,%0r,%1S,%2i', [regexp, string, lastIndex]);
|
||||
// matchIndices is either null or the lastMatchInfo array.
|
||||
var matchIndices = %_RegExpExec(regexp, string, 0, lastMatchInfo);
|
||||
if (matchIndices === null) {
|
||||
if (IS_NULL(matchIndices)) {
|
||||
this.lastIndex = 0;
|
||||
return false;
|
||||
}
|
||||
@ -384,7 +384,7 @@ function RegExpMakeCaptureGetter(n) {
|
||||
var lastMatchInfo = new InternalPackedArray(
|
||||
2, // REGEXP_NUMBER_OF_CAPTURES
|
||||
"", // Last subject.
|
||||
void 0, // Last input - settable with RegExpSetInput.
|
||||
UNDEFINED, // Last input - settable with RegExpSetInput.
|
||||
0, // REGEXP_FIRST_CAPTURE + 0
|
||||
0 // REGEXP_FIRST_CAPTURE + 1
|
||||
);
|
||||
|
@ -526,8 +526,8 @@ function ToNumber(x) {
|
||||
: %StringToNumber(x);
|
||||
}
|
||||
if (IS_BOOLEAN(x)) return x ? 1 : 0;
|
||||
if (IS_UNDEFINED(x)) return $NaN;
|
||||
if (IS_SYMBOL(x)) return $NaN;
|
||||
if (IS_UNDEFINED(x)) return NAN;
|
||||
if (IS_SYMBOL(x)) return NAN;
|
||||
return (IS_NULL(x)) ? 0 : ToNumber(%DefaultNumber(x));
|
||||
}
|
||||
|
||||
@ -537,8 +537,8 @@ function NonNumberToNumber(x) {
|
||||
: %StringToNumber(x);
|
||||
}
|
||||
if (IS_BOOLEAN(x)) return x ? 1 : 0;
|
||||
if (IS_UNDEFINED(x)) return $NaN;
|
||||
if (IS_SYMBOL(x)) return $NaN;
|
||||
if (IS_UNDEFINED(x)) return NAN;
|
||||
if (IS_SYMBOL(x)) return NAN;
|
||||
return (IS_NULL(x)) ? 0 : ToNumber(%DefaultNumber(x));
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,6 @@
|
||||
// This file relies on the fact that the following declaration has been made
|
||||
// in runtime.js:
|
||||
// var $String = global.String;
|
||||
// var $NaN = 0/0;
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
@ -574,7 +573,7 @@ function StringSlice(start, end) {
|
||||
var s_len = s.length;
|
||||
var start_i = TO_INTEGER(start);
|
||||
var end_i = s_len;
|
||||
if (end !== void 0) {
|
||||
if (!IS_UNDEFINED(end)) {
|
||||
end_i = TO_INTEGER(end);
|
||||
}
|
||||
|
||||
@ -699,7 +698,7 @@ function StringSplitOnRegExp(subject, separator, limit, length) {
|
||||
%_CallFunction(result, %_SubString(subject, start, end),
|
||||
ArrayPushBuiltin);
|
||||
} else {
|
||||
%_CallFunction(result, void 0, ArrayPushBuiltin);
|
||||
%_CallFunction(result, UNDEFINED, ArrayPushBuiltin);
|
||||
}
|
||||
if (result.length === limit) break outer_loop;
|
||||
}
|
||||
@ -756,7 +755,7 @@ function StringSubstr(start, n) {
|
||||
|
||||
// Correct n: If not given, set to string length; if explicitly
|
||||
// set to undefined, zero, or negative, returns empty string.
|
||||
if (n === void 0) {
|
||||
if (IS_UNDEFINED(n)) {
|
||||
len = s.length;
|
||||
} else {
|
||||
len = TO_INTEGER(n);
|
||||
@ -765,7 +764,7 @@ function StringSubstr(start, n) {
|
||||
|
||||
// Correct start: If not given (or undefined), set to zero; otherwise
|
||||
// convert to integer and handle negative case.
|
||||
if (start === void 0) {
|
||||
if (IS_UNDEFINED(start)) {
|
||||
start = 0;
|
||||
} else {
|
||||
start = TO_INTEGER(start);
|
||||
|
@ -32,7 +32,6 @@
|
||||
// var $Number = global.Number;
|
||||
// var $Function = global.Function;
|
||||
// var $Array = global.Array;
|
||||
// var $NaN = 0/0;
|
||||
//
|
||||
// in math.js:
|
||||
// var $floor = MathFloor
|
||||
@ -95,7 +94,7 @@ function SetUpLockedPrototype(constructor, fields, methods) {
|
||||
}
|
||||
if (fields) {
|
||||
for (var i = 0; i < fields.length; i++) {
|
||||
%SetProperty(prototype, fields[i], void 0, DONT_ENUM | DONT_DELETE);
|
||||
%SetProperty(prototype, fields[i], UNDEFINED, DONT_ENUM | DONT_DELETE);
|
||||
}
|
||||
}
|
||||
for (var i = 0; i < methods.length; i += 2) {
|
||||
@ -148,7 +147,7 @@ function GlobalParseInt(string, radix) {
|
||||
string = TO_STRING_INLINE(string);
|
||||
radix = TO_INT32(radix);
|
||||
if (!(radix == 0 || (2 <= radix && radix <= 36))) {
|
||||
return $NaN;
|
||||
return NAN;
|
||||
}
|
||||
}
|
||||
|
||||
@ -197,15 +196,16 @@ function GlobalEval(x) {
|
||||
function SetUpGlobal() {
|
||||
%CheckIsBootstrapping();
|
||||
|
||||
var attributes = DONT_ENUM | DONT_DELETE | READ_ONLY;
|
||||
|
||||
// ECMA 262 - 15.1.1.1.
|
||||
%SetProperty(global, "NaN", $NaN, DONT_ENUM | DONT_DELETE | READ_ONLY);
|
||||
%SetProperty(global, "NaN", NAN, attributes);
|
||||
|
||||
// ECMA-262 - 15.1.1.2.
|
||||
%SetProperty(global, "Infinity", 1/0, DONT_ENUM | DONT_DELETE | READ_ONLY);
|
||||
%SetProperty(global, "Infinity", INFINITY, attributes);
|
||||
|
||||
// ECMA-262 - 15.1.1.3.
|
||||
%SetProperty(global, "undefined", void 0,
|
||||
DONT_ENUM | DONT_DELETE | READ_ONLY);
|
||||
%SetProperty(global, "undefined", UNDEFINED, attributes);
|
||||
|
||||
// Set up non-enumerable function on the global object.
|
||||
InstallFunctions(global, DONT_ENUM, $Array(
|
||||
@ -475,12 +475,12 @@ function ToPropertyDescriptor(obj) {
|
||||
function ToCompletePropertyDescriptor(obj) {
|
||||
var desc = ToPropertyDescriptor(obj);
|
||||
if (IsGenericDescriptor(desc) || IsDataDescriptor(desc)) {
|
||||
if (!desc.hasValue()) desc.setValue(void 0);
|
||||
if (!desc.hasValue()) desc.setValue(UNDEFINED);
|
||||
if (!desc.hasWritable()) desc.setWritable(false);
|
||||
} else {
|
||||
// Is accessor descriptor.
|
||||
if (!desc.hasGetter()) desc.setGet(void 0);
|
||||
if (!desc.hasSetter()) desc.setSet(void 0);
|
||||
if (!desc.hasGetter()) desc.setGet(UNDEFINED);
|
||||
if (!desc.hasSetter()) desc.setSet(UNDEFINED);
|
||||
}
|
||||
if (!desc.hasEnumerable()) desc.setEnumerable(false);
|
||||
if (!desc.hasConfigurable()) desc.setConfigurable(false);
|
||||
@ -491,7 +491,7 @@ function ToCompletePropertyDescriptor(obj) {
|
||||
function PropertyDescriptor() {
|
||||
// Initialize here so they are all in-object and have the same map.
|
||||
// Default values from ES5 8.6.1.
|
||||
this.value_ = void 0;
|
||||
this.value_ = UNDEFINED;
|
||||
this.hasValue_ = false;
|
||||
this.writable_ = false;
|
||||
this.hasWritable_ = false;
|
||||
@ -499,9 +499,9 @@ function PropertyDescriptor() {
|
||||
this.hasEnumerable_ = false;
|
||||
this.configurable_ = false;
|
||||
this.hasConfigurable_ = false;
|
||||
this.get_ = void 0;
|
||||
this.get_ = UNDEFINED;
|
||||
this.hasGetter_ = false;
|
||||
this.set_ = void 0;
|
||||
this.set_ = UNDEFINED;
|
||||
this.hasSetter_ = false;
|
||||
}
|
||||
|
||||
@ -593,7 +593,7 @@ function ConvertDescriptorArrayToDescriptor(desc_array) {
|
||||
}
|
||||
|
||||
if (IS_UNDEFINED(desc_array)) {
|
||||
return void 0;
|
||||
return UNDEFINED;
|
||||
}
|
||||
|
||||
var desc = new PropertyDescriptor();
|
||||
@ -647,10 +647,11 @@ function GetOwnProperty(obj, v) {
|
||||
var p = ToName(v);
|
||||
if (%IsJSProxy(obj)) {
|
||||
// TODO(rossberg): adjust once there is a story for symbols vs proxies.
|
||||
if (IS_SYMBOL(v)) return void 0;
|
||||
if (IS_SYMBOL(v)) return UNDEFINED;
|
||||
|
||||
var handler = %GetHandler(obj);
|
||||
var descriptor = CallTrap1(handler, "getOwnPropertyDescriptor", void 0, p);
|
||||
var descriptor = CallTrap1(
|
||||
handler, "getOwnPropertyDescriptor", UNDEFINED, p);
|
||||
if (IS_UNDEFINED(descriptor)) return descriptor;
|
||||
var desc = ToCompletePropertyDescriptor(descriptor);
|
||||
if (!desc.isConfigurable()) {
|
||||
@ -666,7 +667,7 @@ function GetOwnProperty(obj, v) {
|
||||
var props = %GetOwnProperty(ToObject(obj), p);
|
||||
|
||||
// A false value here means that access checks failed.
|
||||
if (props === false) return void 0;
|
||||
if (props === false) return UNDEFINED;
|
||||
|
||||
return ConvertDescriptorArrayToDescriptor(props);
|
||||
}
|
||||
@ -693,7 +694,7 @@ function DefineProxyProperty(obj, p, attributes, should_throw) {
|
||||
if (IS_SYMBOL(p)) return false;
|
||||
|
||||
var handler = %GetHandler(obj);
|
||||
var result = CallTrap2(handler, "defineProperty", void 0, p, attributes);
|
||||
var result = CallTrap2(handler, "defineProperty", UNDEFINED, p, attributes);
|
||||
if (!ToBoolean(result)) {
|
||||
if (should_throw) {
|
||||
throw MakeTypeError("handler_returned_false",
|
||||
@ -710,7 +711,7 @@ function DefineProxyProperty(obj, p, attributes, should_throw) {
|
||||
function DefineObjectProperty(obj, p, desc, should_throw) {
|
||||
var current_or_access = %GetOwnProperty(ToObject(obj), ToName(p));
|
||||
// A false value here means that access checks failed.
|
||||
if (current_or_access === false) return void 0;
|
||||
if (current_or_access === false) return UNDEFINED;
|
||||
|
||||
var current = ConvertDescriptorArrayToDescriptor(current_or_access);
|
||||
var extensible = %IsExtensible(ToObject(obj));
|
||||
@ -841,7 +842,7 @@ function DefineObjectProperty(obj, p, desc, should_throw) {
|
||||
flag |= READ_ONLY;
|
||||
}
|
||||
|
||||
var value = void 0; // Default value is undefined.
|
||||
var value = UNDEFINED; // Default value is undefined.
|
||||
if (desc.hasValue()) {
|
||||
value = desc.getValue();
|
||||
} else if (!IS_UNDEFINED(current) && IsDataDescriptor(current)) {
|
||||
@ -920,7 +921,7 @@ function DefineArrayProperty(obj, p, desc, should_throw) {
|
||||
// For the time being, we need a hack to prevent Object.observe from
|
||||
// generating two change records.
|
||||
obj.length = new_length;
|
||||
desc.value_ = void 0;
|
||||
desc.value_ = UNDEFINED;
|
||||
desc.hasValue_ = false;
|
||||
threw = !DefineObjectProperty(obj, "length", desc, should_throw) || threw;
|
||||
if (emit_splice) {
|
||||
@ -1045,7 +1046,7 @@ function ObjectGetOwnPropertyNames(obj) {
|
||||
// Special handling for proxies.
|
||||
if (%IsJSProxy(obj)) {
|
||||
var handler = %GetHandler(obj);
|
||||
var names = CallTrap0(handler, "getOwnPropertyNames", void 0);
|
||||
var names = CallTrap0(handler, "getOwnPropertyNames", UNDEFINED);
|
||||
return ToNameArray(names, "getOwnPropertyNames", false);
|
||||
}
|
||||
|
||||
@ -1194,7 +1195,7 @@ function ObjectDefineProperties(obj, properties) {
|
||||
// Harmony proxies.
|
||||
function ProxyFix(obj) {
|
||||
var handler = %GetHandler(obj);
|
||||
var props = CallTrap0(handler, "fix", void 0);
|
||||
var props = CallTrap0(handler, "fix", UNDEFINED);
|
||||
if (IS_UNDEFINED(props)) {
|
||||
throw MakeTypeError("handler_returned_undefined", [handler, "fix"]);
|
||||
}
|
||||
@ -1560,8 +1561,8 @@ function NumberToFixed(fractionDigits) {
|
||||
}
|
||||
|
||||
if (NUMBER_IS_NAN(x)) return "NaN";
|
||||
if (x == 1/0) return "Infinity";
|
||||
if (x == -1/0) return "-Infinity";
|
||||
if (x == INFINITY) return "Infinity";
|
||||
if (x == -INFINITY) return "-Infinity";
|
||||
|
||||
return %NumberToFixed(x, f);
|
||||
}
|
||||
@ -1578,11 +1579,11 @@ function NumberToExponential(fractionDigits) {
|
||||
// Get the value of this number in case it's an object.
|
||||
x = %_ValueOf(this);
|
||||
}
|
||||
var f = IS_UNDEFINED(fractionDigits) ? void 0 : TO_INTEGER(fractionDigits);
|
||||
var f = IS_UNDEFINED(fractionDigits) ? UNDEFINED : TO_INTEGER(fractionDigits);
|
||||
|
||||
if (NUMBER_IS_NAN(x)) return "NaN";
|
||||
if (x == 1/0) return "Infinity";
|
||||
if (x == -1/0) return "-Infinity";
|
||||
if (x == INFINITY) return "Infinity";
|
||||
if (x == -INFINITY) return "-Infinity";
|
||||
|
||||
if (IS_UNDEFINED(f)) {
|
||||
f = -1; // Signal for runtime function that f is not defined.
|
||||
@ -1608,8 +1609,8 @@ function NumberToPrecision(precision) {
|
||||
var p = TO_INTEGER(precision);
|
||||
|
||||
if (NUMBER_IS_NAN(x)) return "NaN";
|
||||
if (x == 1/0) return "Infinity";
|
||||
if (x == -1/0) return "-Infinity";
|
||||
if (x == INFINITY) return "Infinity";
|
||||
if (x == -INFINITY) return "-Infinity";
|
||||
|
||||
if (p < 1 || p > 21) {
|
||||
throw new $RangeError("toPrecision() argument must be between 1 and 21");
|
||||
@ -1654,18 +1655,18 @@ function SetUpNumber() {
|
||||
DONT_ENUM | DONT_DELETE | READ_ONLY);
|
||||
|
||||
// ECMA-262 section 15.7.3.3.
|
||||
%SetProperty($Number, "NaN", $NaN, DONT_ENUM | DONT_DELETE | READ_ONLY);
|
||||
%SetProperty($Number, "NaN", NAN, DONT_ENUM | DONT_DELETE | READ_ONLY);
|
||||
|
||||
// ECMA-262 section 15.7.3.4.
|
||||
%SetProperty($Number,
|
||||
"NEGATIVE_INFINITY",
|
||||
-1/0,
|
||||
-INFINITY,
|
||||
DONT_ENUM | DONT_DELETE | READ_ONLY);
|
||||
|
||||
// ECMA-262 section 15.7.3.5.
|
||||
%SetProperty($Number,
|
||||
"POSITIVE_INFINITY",
|
||||
1/0,
|
||||
INFINITY,
|
||||
DONT_ENUM | DONT_DELETE | READ_ONLY);
|
||||
%ToFastProperties($Number);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user