Bug 1716901 - Remove _ prefix from self-hosting intrinsics. r=jandem

We never had any consistency with how we named the intrinsics, so remove the
underscore prefix to match the rest of the intrinsics.

Differential Revision: https://phabricator.services.mozilla.com/D118236
This commit is contained in:
Ted Campbell 2021-06-21 20:13:50 +00:00
Родитель 3fb8bb1131
Коммит e3100c80ba
27 изменённых файлов: 199 добавлений и 201 удалений

Просмотреть файл

@ -113,7 +113,7 @@ function ArrayEvery(callbackfn/*, thisArg*/) {
return true;
}
// Inlining this enables inlining of the callback function.
_SetIsInlinableLargeFunction(ArrayEvery);
SetIsInlinableLargeFunction(ArrayEvery);
/* ES5 15.4.4.17. */
function ArraySome(callbackfn/*, thisArg*/) {
@ -147,7 +147,7 @@ function ArraySome(callbackfn/*, thisArg*/) {
return false;
}
// Inlining this enables inlining of the callback function.
_SetIsInlinableLargeFunction(ArraySome);
SetIsInlinableLargeFunction(ArraySome);
// ES2018 draft rev 3bbc87cd1b9d3bf64c3e68ca2fe9c5a3f2c304c0
// 22.1.3.25 Array.prototype.sort ( comparefn )
@ -225,7 +225,7 @@ function ArrayForEach(callbackfn/*, thisArg*/) {
return void 0;
}
// Inlining this enables inlining of the callback function.
_SetIsInlinableLargeFunction(ArrayForEach);
SetIsInlinableLargeFunction(ArrayForEach);
/* ES 2016 draft Mar 25, 2016 22.1.3.15. */
function ArrayMap(callbackfn/*, thisArg*/) {
@ -254,7 +254,7 @@ function ArrayMap(callbackfn/*, thisArg*/) {
if (k in O) {
/* Steps 7.c.i-iii. */
var mappedValue = callContentFunction(callbackfn, T, O[k], k, O);
_DefineDataProperty(A, k, mappedValue);
DefineDataProperty(A, k, mappedValue);
}
}
@ -262,7 +262,7 @@ function ArrayMap(callbackfn/*, thisArg*/) {
return A;
}
// Inlining this enables inlining of the callback function.
_SetIsInlinableLargeFunction(ArrayMap);
SetIsInlinableLargeFunction(ArrayMap);
/* ES 2016 draft Mar 25, 2016 22.1.3.7 Array.prototype.filter. */
function ArrayFilter(callbackfn/*, thisArg*/) {
@ -295,7 +295,7 @@ function ArrayFilter(callbackfn/*, thisArg*/) {
var selected = callContentFunction(callbackfn, T, kValue, k, O);
/* Step 8.c.iii. */
if (selected)
_DefineDataProperty(A, to++, kValue);
DefineDataProperty(A, to++, kValue);
}
}
@ -707,15 +707,15 @@ function ArrayIteratorNext() {
return result;
}
// We want to inline this to do scalar replacement of the result object.
_SetIsInlinableLargeFunction(ArrayIteratorNext);
SetIsInlinableLargeFunction(ArrayIteratorNext);
// Uncloned functions with `$` prefix are allocated as extended function
// to store the original name in `_SetCanonicalName`.
// to store the original name in `SetCanonicalName`.
function $ArrayValues() {
return CreateArrayIterator(this, ITEM_KIND_VALUE);
}
_SetCanonicalName($ArrayValues, "values");
SetCanonicalName($ArrayValues, "values");
function ArrayEntries() {
return CreateArrayIterator(this, ITEM_KIND_KEY_AND_VALUE);
@ -760,9 +760,9 @@ function ArrayFrom(items, mapfn = undefined, thisArg = undefined) {
for (var nextValue of allowContentIter(iterator)) {
// Step 5.e.i.
// Disabled for performance reason. We won't hit this case on
// normal array, since _DefineDataProperty will throw before it.
// normal array, since DefineDataProperty will throw before it.
// We could hit this when |A| is a proxy and it ignores
// |_DefineDataProperty|, but it happens only after too long loop.
// |DefineDataProperty|, but it happens only after too long loop.
/*
if (k >= 0x1fffffffffffff)
ThrowTypeError(JSMSG_TOO_LONG_ARRAY);
@ -772,7 +772,7 @@ function ArrayFrom(items, mapfn = undefined, thisArg = undefined) {
var mappedValue = mapping ? callContentFunction(mapfn, T, nextValue, k) : nextValue;
// Steps 5.e.ii (reordered), 5.e.viii.
_DefineDataProperty(A, k++, mappedValue);
DefineDataProperty(A, k++, mappedValue);
}
// Step 5.e.iv.
@ -801,7 +801,7 @@ function ArrayFrom(items, mapfn = undefined, thisArg = undefined) {
var mappedValue = mapping ? callContentFunction(mapfn, T, kValue, k) : kValue;
// Steps 16.f-g.
_DefineDataProperty(A, k, mappedValue);
DefineDataProperty(A, k, mappedValue);
}
// Steps 17-18.
@ -900,7 +900,7 @@ function $ArraySpecies() {
// Step 1.
return this;
}
_SetCanonicalName($ArraySpecies, "get [Symbol.species]");
SetCanonicalName($ArraySpecies, "get [Symbol.species]");
// ES 2016 draft Mar 25, 2016 9.4.2.3.
function ArraySpeciesCreate(originalArray, length) {
@ -1003,7 +1003,7 @@ function ArrayConcat(arg1) {
for (k = 0; k < len; k++) {
// Steps 5.c.iv.1-3.
// IsPackedArray(E) ensures that |k in E| is always true.
_DefineDataProperty(A, n, E[k]);
DefineDataProperty(A, n, E[k]);
// Step 5.c.iv.4.
n++;
@ -1013,7 +1013,7 @@ function ArrayConcat(arg1) {
for (k = 0; k < len; k++) {
// Steps 5.c.iv.1-3.
if (k in E)
_DefineDataProperty(A, n, E[k]);
DefineDataProperty(A, n, E[k]);
// Step 5.c.iv.4.
n++;
@ -1025,7 +1025,7 @@ function ArrayConcat(arg1) {
ThrowTypeError(JSMSG_TOO_LONG_ARRAY);
// Step 5.d.ii.
_DefineDataProperty(A, n, E);
DefineDataProperty(A, n, E);
// Step 5.d.iii.
n++;
@ -1140,7 +1140,7 @@ function FlattenIntoArray(target, source, sourceLen, start, depth, mapperFunctio
ThrowTypeError(JSMSG_TOO_LONG_ARRAY);
// Step 3.c.vi.2.
_DefineDataProperty(target, targetIndex, element);
DefineDataProperty(target, targetIndex, element);
// Step 3.c.vi.3.
targetIndex++;
@ -1181,4 +1181,4 @@ function ArrayAt(index) {
return O[k];
}
// This function is only barely too long for normal inlining.
_SetIsInlinableLargeFunction(ArrayAt);
SetIsInlinableLargeFunction(ArrayAt);

Просмотреть файл

@ -443,7 +443,7 @@ async function AsyncIteratorToArray() {
// Step 3.
for await (const value of allowContentIter(iterated)) {
// Step d.
_DefineDataProperty(items, index++, value);
DefineDataProperty(items, index++, value);
}
// Step 3b.
return items;

Просмотреть файл

@ -29,7 +29,7 @@ function FunctionBind(thisArg, ...boundArgs) {
}
// Steps 5-11.
_FinishBoundFunctionInit(F, target, argCount);
FinishBoundFunctionInit(F, target, argCount);
// Ensure that the apply intrinsic has been cloned so it can be baked into
// JIT code.
@ -68,7 +68,7 @@ function bind_bindFunction0(fun, thisArg, boundArgs) {
if (false) void boundArgs;
var newTarget;
if (_IsConstructing()) {
if (IsConstructing()) {
newTarget = new.target;
if (newTarget === $bound)
newTarget = fun;
@ -119,7 +119,7 @@ function bind_bindFunction1(fun, thisArg, boundArgs) {
if (false) void boundArgs;
var newTarget;
if (_IsConstructing()) {
if (IsConstructing()) {
newTarget = new.target;
if (newTarget === $bound)
newTarget = fun;
@ -158,9 +158,9 @@ function bind_bindFunction1(fun, thisArg, boundArgs) {
combiner = function() {
var callArgsCount = arguments.length;
var args = std_Array(1 + callArgsCount);
_DefineDataProperty(args, 0, bound1);
DefineDataProperty(args, 0, bound1);
for (var i = 0; i < callArgsCount; i++)
_DefineDataProperty(args, i + 1, arguments[i]);
DefineDataProperty(args, i + 1, arguments[i]);
return args;
};
}
@ -182,7 +182,7 @@ function bind_bindFunction2(fun, thisArg, boundArgs) {
if (false) void boundArgs;
var newTarget;
if (_IsConstructing()) {
if (IsConstructing()) {
newTarget = new.target;
if (newTarget === $bound)
newTarget = fun;
@ -221,10 +221,10 @@ function bind_bindFunction2(fun, thisArg, boundArgs) {
combiner = function() {
var callArgsCount = arguments.length;
var args = std_Array(2 + callArgsCount);
_DefineDataProperty(args, 0, bound1);
_DefineDataProperty(args, 1, bound2);
DefineDataProperty(args, 0, bound1);
DefineDataProperty(args, 1, bound2);
for (var i = 0; i < callArgsCount; i++)
_DefineDataProperty(args, i + 2, arguments[i]);
DefineDataProperty(args, i + 2, arguments[i]);
return args;
};
}
@ -241,7 +241,7 @@ function bind_bindFunctionN(fun, thisArg, boundArgs) {
var combiner = null;
return function $bound() {
var newTarget;
if (_IsConstructing()) {
if (IsConstructing()) {
newTarget = new.target;
if (newTarget === $bound)
newTarget = fun;
@ -258,9 +258,9 @@ function bind_bindFunctionN(fun, thisArg, boundArgs) {
var callArgsCount = arguments.length;
var args = std_Array(boundArgsCount + callArgsCount);
for (var i = 0; i < boundArgsCount; i++)
_DefineDataProperty(args, i, boundArgs[i]);
DefineDataProperty(args, i, boundArgs[i]);
for (var i = 0; i < callArgsCount; i++)
_DefineDataProperty(args, i + boundArgsCount, arguments[i]);
DefineDataProperty(args, i + boundArgsCount, arguments[i]);
return args;
};
}
@ -276,7 +276,7 @@ function bind_mapArguments() {
var len = arguments.length;
var args = std_Array(len);
for (var i = 0; i < len; i++)
_DefineDataProperty(args, i, arguments[i]);
DefineDataProperty(args, i, arguments[i]);
return args;
}
@ -336,6 +336,6 @@ function bind_constructFunctionN(fun, newTarget, args) {
default:
assert(args.length !== 0,
"bound function construction without args should be handled by caller");
return _ConstructFunction(fun, newTarget, args);
return ConstructFunction(fun, newTarget, args);
}
}

Просмотреть файл

@ -46,11 +46,11 @@ function MapForEach(callbackfn, thisArg = undefined) {
var mapIterationResultPair = iteratorTemp.mapIterationResultPair;
if (!mapIterationResultPair) {
mapIterationResultPair = iteratorTemp.mapIterationResultPair =
_CreateMapIterationResultPair();
CreateMapIterationResultPair();
}
while (true) {
var done = _GetNextMapEntryForIterator(entries, mapIterationResultPair);
var done = GetNextMapEntryForIterator(entries, mapIterationResultPair);
if (done)
break;
@ -73,19 +73,19 @@ function MapIteratorNext() {
if (!IsObject(O) || (O = GuardToMapIterator(O)) === null)
return callFunction(CallMapIteratorMethodIfWrapped, this, "MapIteratorNext");
// Steps 4-5 (implemented in _GetNextMapEntryForIterator).
// Steps 4-5 (implemented in GetNextMapEntryForIterator).
// Steps 8-9 (omitted).
var mapIterationResultPair = iteratorTemp.mapIterationResultPair;
if (!mapIterationResultPair) {
mapIterationResultPair = iteratorTemp.mapIterationResultPair =
_CreateMapIterationResultPair();
CreateMapIterationResultPair();
}
var retVal = {value: undefined, done: true};
// Step 10.a, 11.
var done = _GetNextMapEntryForIterator(O, mapIterationResultPair);
var done = GetNextMapEntryForIterator(O, mapIterationResultPair);
if (!done) {
// Steps 10.b-c (omitted).
@ -117,9 +117,9 @@ function MapIteratorNext() {
// ES6 final draft 23.1.2.2.
// Uncloned functions with `$` prefix are allocated as extended function
// to store the original name in `_SetCanonicalName`.
// to store the original name in `SetCanonicalName`.
function $MapSpecies() {
// Step 1.
return this;
}
_SetCanonicalName($MapSpecies, "get [Symbol.species]");
SetCanonicalName($MapSpecies, "get [Symbol.species]");

Просмотреть файл

@ -311,7 +311,7 @@ bool MapIteratorObject::next(MapIteratorObject* mapIterator,
// IC code calls this directly.
AutoUnsafeCallWithABI unsafe;
// Check invariants for inlined _GetNextMapEntryForIterator.
// Check invariants for inlined GetNextMapEntryForIterator.
// The array should be tenured, so that post-barrier can be done simply.
MOZ_ASSERT(resultPairObj->isTenured());

Просмотреть файл

@ -29,7 +29,7 @@ function ModuleGetExportedNames(exportStarSet = [])
return [];
// Step 5
_DefineDataProperty(exportStarSet, exportStarSet.length, module);
DefineDataProperty(exportStarSet, exportStarSet.length, module);
// Step 6
let exportedNames = [];
@ -39,14 +39,14 @@ function ModuleGetExportedNames(exportStarSet = [])
let localExportEntries = module.localExportEntries;
for (let i = 0; i < localExportEntries.length; i++) {
let e = localExportEntries[i];
_DefineDataProperty(exportedNames, namesCount++, e.exportName);
DefineDataProperty(exportedNames, namesCount++, e.exportName);
}
// Step 8
let indirectExportEntries = module.indirectExportEntries;
for (let i = 0; i < indirectExportEntries.length; i++) {
let e = indirectExportEntries[i];
_DefineDataProperty(exportedNames, namesCount++, e.exportName);
DefineDataProperty(exportedNames, namesCount++, e.exportName);
}
// Step 9
@ -60,7 +60,7 @@ function ModuleGetExportedNames(exportStarSet = [])
for (let j = 0; j < starNames.length; j++) {
let n = starNames[j];
if (n !== "default" && !callFunction(ArrayIncludes, exportedNames, n))
_DefineDataProperty(exportedNames, namesCount++, n);
DefineDataProperty(exportedNames, namesCount++, n);
}
}
@ -121,7 +121,7 @@ function ModuleResolveExport(exportName, resolveSet = [])
}
// Step 5
_DefineDataProperty(resolveSet, resolveSet.length, {module, exportName});
DefineDataProperty(resolveSet, resolveSet.length, {module, exportName});
// Step 6
let localExportEntries = module.localExportEntries;
@ -211,7 +211,7 @@ function GetModuleNamespace(module)
let name = exportedNames[i];
let resolution = callFunction(module.resolveExport, module, name);
if (IsResolvedBinding(resolution))
_DefineDataProperty(unambiguousNames, unambiguousNames.length, name);
DefineDataProperty(unambiguousNames, unambiguousNames.length, name);
}
namespace = ModuleNamespaceCreate(module, unambiguousNames);
}
@ -384,7 +384,7 @@ function InnerModuleLinking(module, stack, index)
index++;
// Step 8. Append module to stack.
_DefineDataProperty(stack, stack.length, module);
DefineDataProperty(stack, stack.length, module);
// Step 9. For each String required that is an element of module.[[RequestedModules]], do
let requestedModules = module.requestedModules;
@ -685,7 +685,7 @@ function InnerModuleEvaluation(module, stack, index)
index++;
// Step 9
_DefineDataProperty(stack, stack.length, module);
DefineDataProperty(stack, stack.length, module);
// Step 10
let requestedModules = module.requestedModules;

Просмотреть файл

@ -22,7 +22,7 @@ function ObjectGetOwnPropertyDescriptors(O) {
// Step 4.c.
if (typeof desc !== "undefined")
_DefineDataProperty(descriptors, key, desc);
DefineDataProperty(descriptors, key, desc);
}
// Step 5.
@ -66,14 +66,14 @@ function Object_hasOwnProperty(V) {
function $ObjectProtoGetter() {
return std_Reflect_getPrototypeOf(ToObject(this));
}
_SetCanonicalName($ObjectProtoGetter, "get __proto__");
SetCanonicalName($ObjectProtoGetter, "get __proto__");
// ES 2021 draft rev 0b988b7700de675331ac360d164c978d6ea452ec
// B.2.2.1.2 set Object.prototype.__proto__
function $ObjectProtoSetter(proto) {
return callFunction(std_Object_setProto, this, proto);
}
_SetCanonicalName($ObjectProtoSetter, "set __proto__");
SetCanonicalName($ObjectProtoSetter, "set __proto__");
// ES7 draft (2016 March 8) B.2.2.3
function ObjectDefineSetter(name, setter) {
@ -88,8 +88,8 @@ function ObjectDefineSetter(name, setter) {
var key = TO_PROPERTY_KEY(name);
// Steps 3, 5.
_DefineProperty(object, key, ACCESSOR_DESCRIPTOR_KIND | ATTR_ENUMERABLE | ATTR_CONFIGURABLE,
null, setter, true);
DefineProperty(object, key, ACCESSOR_DESCRIPTOR_KIND | ATTR_ENUMERABLE | ATTR_CONFIGURABLE,
null, setter, true);
// Step 6. (implicit)
}
@ -107,8 +107,8 @@ function ObjectDefineGetter(name, getter) {
var key = TO_PROPERTY_KEY(name);
// Steps 3, 5.
_DefineProperty(object, key, ACCESSOR_DESCRIPTOR_KIND | ATTR_ENUMERABLE | ATTR_CONFIGURABLE,
getter, null, true);
DefineProperty(object, key, ACCESSOR_DESCRIPTOR_KIND | ATTR_ENUMERABLE | ATTR_CONFIGURABLE,
getter, null, true);
// Step 6. (implicit)
}
@ -268,27 +268,27 @@ function ObjectOrReflectDefineProperty(obj, propertyKey, attributes, strict) {
ThrowTypeError(JSMSG_INVALID_DESCRIPTOR);
// Step 4 (accessor descriptor property).
return _DefineProperty(obj, propertyKey, attrs, getter, setter, strict);
return DefineProperty(obj, propertyKey, attrs, getter, setter, strict);
}
// Step 4 (data property descriptor with value).
if (hasValue) {
// Use the inlinable _DefineDataProperty function when possible.
// Use the inlinable DefineDataProperty function when possible.
if (strict) {
if ((attrs & (ATTR_ENUMERABLE | ATTR_CONFIGURABLE | ATTR_WRITABLE)) ===
(ATTR_ENUMERABLE | ATTR_CONFIGURABLE | ATTR_WRITABLE))
{
_DefineDataProperty(obj, propertyKey, value);
DefineDataProperty(obj, propertyKey, value);
return true;
}
}
// The fifth argument is set to |null| to mark that |value| is present.
return _DefineProperty(obj, propertyKey, attrs, value, null, strict);
return DefineProperty(obj, propertyKey, attrs, value, null, strict);
}
// Step 4 (generic property descriptor or data property without value).
return _DefineProperty(obj, propertyKey, attrs, undefined, undefined, strict);
return DefineProperty(obj, propertyKey, attrs, undefined, undefined, strict);
}
// ES2017 draft rev 6859bb9ccaea9c6ede81d71e5320e3833b92cb3e
@ -317,7 +317,7 @@ function ObjectFromEntries(iter) {
for (const pair of allowContentIter(iter)) {
if (!IsObject(pair))
ThrowTypeError(JSMSG_INVALID_MAP_ITERABLE, "Object.fromEntries");
_DefineDataProperty(obj, pair[0], pair[1]);
DefineDataProperty(obj, pair[0], pair[1]);
}
return obj;

Просмотреть файл

@ -20,7 +20,7 @@ function CreateListFromArrayLikeForArgs(obj) {
// Steps 4-6.
var list = std_Array(len);
for (var i = 0; i < len; i++)
_DefineDataProperty(list, i, obj[i]);
DefineDataProperty(list, i, obj[i]);
// Step 7.
return list;
@ -100,7 +100,7 @@ function Reflect_construct(target, argumentsList/*, newTarget*/) {
case 12:
return constructContentFunction(target, newTarget, SPREAD(args, 12));
default:
return _ConstructFunction(target, newTarget, args);
return ConstructFunction(target, newTarget, args);
}
}

Просмотреть файл

@ -5,7 +5,7 @@
// ECMAScript 2020 draft (2020/03/12) 21.2.5.4 get RegExp.prototype.flags
// https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
// Uncloned functions with `$` prefix are allocated as extended function
// to store the original name in `_SetCanonicalName`.
// to store the original name in `SetCanonicalName`.
function $RegExpFlagsGetter() {
// Steps 1-2.
var R = this;
@ -46,7 +46,7 @@ function $RegExpFlagsGetter() {
// Step 18.
return result;
}
_SetCanonicalName($RegExpFlagsGetter, "get flags");
SetCanonicalName($RegExpFlagsGetter, "get flags");
// ES 2017 draft 40edb3a95a475c1b251141ac681b8793129d9a6d 21.2.5.14.
function $RegExpToString()
@ -67,7 +67,7 @@ function $RegExpToString()
// Steps 5-6.
return "/" + pattern + "/" + flags;
}
_SetCanonicalName($RegExpToString, "toString");
SetCanonicalName($RegExpToString, "toString");
// ES 2016 draft Mar 25, 2016 21.2.5.2.3.
function AdvanceStringIndex(S, index) {
@ -172,7 +172,7 @@ function RegExpMatchSlowPath(rx, S) {
var matchStr = ToString(result[0]);
// Step 6.e.iii.2.
_DefineDataProperty(A, n, matchStr);
DefineDataProperty(A, n, matchStr);
// Step 6.e.iii.4.
if (matchStr === "") {
@ -216,7 +216,7 @@ function RegExpGlobalMatchOpt(rx, S, fullUnicode) {
var matchStr = result[0];
// Step 6.e.iii.2.
_DefineDataProperty(A, n, matchStr);
DefineDataProperty(A, n, matchStr);
// Step 6.e.iii.4.
if (matchStr === "") {
@ -362,7 +362,7 @@ function RegExpReplaceSlowPath(rx, S, lengthS, replaceValue,
break;
// Step 11.c.i.
_DefineDataProperty(results, nResults++, result);
DefineDataProperty(results, nResults++, result);
// Step 11.c.ii.
if (!global)
@ -460,7 +460,7 @@ function RegExpGetComplexReplacement(result, matched, S, position,
var capturesLength = 0;
// Step 14.k.i (reordered).
_DefineDataProperty(captures, capturesLength++, matched);
DefineDataProperty(captures, capturesLength++, matched);
// Step 14.g, 14.i, 14.i.iv.
for (var n = 1; n <= nCaptures; n++) {
@ -472,7 +472,7 @@ function RegExpGetComplexReplacement(result, matched, S, position,
capN = ToString(capN);
// Step 14.i.iii.
_DefineDataProperty(captures, capturesLength++, capN);
DefineDataProperty(captures, capturesLength++, capN);
}
// Step 14.j.
@ -497,10 +497,10 @@ function RegExpGetComplexReplacement(result, matched, S, position,
}
}
// Steps 14.k.ii-v.
_DefineDataProperty(captures, capturesLength++, position);
_DefineDataProperty(captures, capturesLength++, S);
DefineDataProperty(captures, capturesLength++, position);
DefineDataProperty(captures, capturesLength++, S);
if (namedCaptures !== undefined) {
_DefineDataProperty(captures, capturesLength++, namedCaptures);
DefineDataProperty(captures, capturesLength++, namedCaptures);
}
return ToString(callFunction(std_Function_apply, replaceValue, undefined, captures));
}
@ -550,16 +550,16 @@ function RegExpGetFunctionalReplacement(result, S, position, replaceValue) {
for (var n = 0; n <= nCaptures; n++) {
assert(typeof result[n] === "string" || result[n] === undefined,
"RegExpMatcher returns only strings and undefined");
_DefineDataProperty(captures, n, result[n]);
DefineDataProperty(captures, n, result[n]);
}
// Step 14.k.iii.
_DefineDataProperty(captures, nCaptures + 1, position);
_DefineDataProperty(captures, nCaptures + 2, S);
DefineDataProperty(captures, nCaptures + 1, position);
DefineDataProperty(captures, nCaptures + 2, S);
// Step 14.k.iv.
if (namedCaptures !== undefined) {
_DefineDataProperty(captures, nCaptures + 3, namedCaptures);
DefineDataProperty(captures, nCaptures + 3, namedCaptures);
}
// Steps 14.k.v-vi.
@ -879,7 +879,7 @@ function RegExpSplit(string, limit) {
return A;
// Step 17.d.
_DefineDataProperty(A, 0, S);
DefineDataProperty(A, 0, S);
// Step 17.e.
return A;
@ -933,7 +933,7 @@ function RegExpSplit(string, limit) {
}
// Steps 19.d.iv.1-3.
_DefineDataProperty(A, lengthA, Substring(S, p, q - p));
DefineDataProperty(A, lengthA, Substring(S, p, q - p));
// Step 19.d.iv.4.
lengthA++;
@ -954,7 +954,7 @@ function RegExpSplit(string, limit) {
// Step 19.d.iv.10.
while (i <= numberOfCaptures) {
// Steps 19.d.iv.10.a-b.
_DefineDataProperty(A, lengthA, z[i]);
DefineDataProperty(A, lengthA, z[i]);
// Step 19.d.iv.10.c.
i++;
@ -973,9 +973,9 @@ function RegExpSplit(string, limit) {
// Steps 20-22.
if (p >= size)
_DefineDataProperty(A, lengthA, "");
DefineDataProperty(A, lengthA, "");
else
_DefineDataProperty(A, lengthA, Substring(S, p, size - p));
DefineDataProperty(A, lengthA, Substring(S, p, size - p));
// Step 23.
return A;
@ -1116,7 +1116,7 @@ function $RegExpSpecies() {
// Step 1.
return this;
}
_SetCanonicalName($RegExpSpecies, "get [Symbol.species]");
SetCanonicalName($RegExpSpecies, "get [Symbol.species]");
function IsRegExpMatchAllOptimizable(rx, C) {
if (!IsRegExpObject(rx))

Просмотреть файл

@ -39,10 +39,10 @@ function SetForEach(callbackfn, thisArg = undefined) {
// Inlined: SetIteratorNext
var setIterationResult = setIteratorTemp.setIterationResult;
if (!setIterationResult)
setIterationResult = setIteratorTemp.setIterationResult = _CreateSetIterationResult();
setIterationResult = setIteratorTemp.setIterationResult = CreateSetIterationResult();
while (true) {
var done = _GetNextSetEntryForIterator(values, setIterationResult);
var done = GetNextSetEntryForIterator(values, setIterationResult);
if (done)
break;
@ -55,12 +55,12 @@ function SetForEach(callbackfn, thisArg = undefined) {
// ES6 final draft 23.2.2.2.
// Uncloned functions with `$` prefix are allocated as extended function
// to store the original name in `_SetCanonicalName`.
// to store the original name in `SetCanonicalName`.
function $SetSpecies() {
// Step 1.
return this;
}
_SetCanonicalName($SetSpecies, "get [Symbol.species]");
SetCanonicalName($SetSpecies, "get [Symbol.species]");
var setIteratorTemp = { setIterationResult: null };
@ -73,17 +73,17 @@ function SetIteratorNext() {
if (!IsObject(O) || (O = GuardToSetIterator(O)) === null)
return callFunction(CallSetIteratorMethodIfWrapped, this, "SetIteratorNext");
// Steps 4-5 (implemented in _GetNextSetEntryForIterator).
// Steps 4-5 (implemented in GetNextSetEntryForIterator).
// Steps 8-9 (omitted).
var setIterationResult = setIteratorTemp.setIterationResult;
if (!setIterationResult)
setIterationResult = setIteratorTemp.setIterationResult = _CreateSetIterationResult();
setIterationResult = setIteratorTemp.setIterationResult = CreateSetIterationResult();
var retVal = {value: undefined, done: true};
// Steps 10.a, 11.
var done = _GetNextSetEntryForIterator(O, setIterationResult);
var done = GetNextSetEntryForIterator(O, setIterationResult);
if (!done) {
// Steps 10.b-c (omitted).

Просмотреть файл

@ -121,7 +121,7 @@ function RadixSort(array, len, buffer, nbytes, signed, floating, comparefn) {
let aux = [];
for (let i = 0; i < len; i++)
_DefineDataProperty(aux, i, 0);
DefineDataProperty(aux, i, 0);
let view = array;
let signMask = 1 << nbytes * 8 - 1;
@ -230,7 +230,7 @@ function Merge(list, out, start, mid, end, comparefn) {
// Skip calling the comparator if the sub-list is already sorted.
if (mid >= end || comparefn(list[mid], list[mid + 1]) <= 0) {
for (var i = start; i <= end; i++) {
_DefineDataProperty(out, i, list[i]);
DefineDataProperty(out, i, list[i]);
}
return;
}
@ -242,20 +242,20 @@ function Merge(list, out, start, mid, end, comparefn) {
var lvalue = list[i];
var rvalue = list[j];
if (comparefn(lvalue, rvalue) <= 0) {
_DefineDataProperty(out, k++, lvalue);
DefineDataProperty(out, k++, lvalue);
i++;
} else {
_DefineDataProperty(out, k++, rvalue);
DefineDataProperty(out, k++, rvalue);
j++;
}
}
// Empty out any remaining elements.
while (i <= mid) {
_DefineDataProperty(out, k++, list[i++]);
DefineDataProperty(out, k++, list[i++]);
}
while (j <= end) {
_DefineDataProperty(out, k++, list[j++]);
DefineDataProperty(out, k++, list[j++]);
}
}
@ -277,7 +277,7 @@ function MergeSort(array, len, comparefn) {
for (var i = 0; i < len; i++) {
if (i in array)
_DefineDataProperty(denseList, denseLen++, array[i]);
DefineDataProperty(denseList, denseLen++, array[i]);
}
if (denseLen < 1)
@ -373,7 +373,7 @@ function MergeSortTypedArray(array, len, comparefn) {
}
// Use the same TypedArray kind for the buffer.
var C = _ConstructorForTypedArray(array);
var C = ConstructorForTypedArray(array);
// We do all of our allocating up front.
var lBuffer = array;

Просмотреть файл

@ -517,7 +517,7 @@ function String_substring(start, end) {
// double. Eagerly truncate since SubstringKernel only accepts int32.
return SubstringKernel(str, from | 0, (to - from) | 0);
}
_SetIsInlinableLargeFunction(String_substring);
SetIsInlinableLargeFunction(String_substring);
// ES2020 draft rev dc1e21c454bd316810be1c0e7af0131a2d7f38e9
// B.2.3.1 String.prototype.substr ( start, length )
@ -555,7 +555,7 @@ function String_substr(start, length) {
// double. Eagerly truncate since SubstringKernel only accepts int32.
return SubstringKernel(str, intStart | 0, resultLength | 0);
}
_SetIsInlinableLargeFunction(String_substr);
SetIsInlinableLargeFunction(String_substr);
// ES2021 draft rev 12a546b92275a0e2f834017db2727bb9c6f6c8fd
// 21.1.3.4 String.prototype.concat ( ...args )
@ -629,7 +629,7 @@ function String_slice(start, end) {
// double. Eagerly truncate since SubstringKernel only accepts int32.
return SubstringKernel(str, from | 0, span | 0);
}
_SetIsInlinableLargeFunction(String_slice);
SetIsInlinableLargeFunction(String_slice);
// ES2020 draft rev dc1e21c454bd316810be1c0e7af0131a2d7f38e9
// 21.1.3.3 String.prototype.codePointAt ( pos )

Просмотреть файл

@ -74,7 +74,7 @@ function IsTypedArrayEnsuringArrayBuffer(arg) {
// 7.3.20 SpeciesConstructor ( O, defaultConstructor )
//
// SpeciesConstructor function optimized for TypedArrays to avoid calling
// _ConstructorForTypedArray, a non-inlineable runtime function, in the normal
// ConstructorForTypedArray, a non-inlineable runtime function, in the normal
// case.
function TypedArraySpeciesConstructor(obj) {
// Step 1.
@ -85,7 +85,7 @@ function TypedArraySpeciesConstructor(obj) {
// Step 3.
if (ctor === undefined)
return _ConstructorForTypedArray(obj);
return ConstructorForTypedArray(obj);
// Step 4.
if (!IsObject(ctor))
@ -96,7 +96,7 @@ function TypedArraySpeciesConstructor(obj) {
// Step 6.
if (s === undefined || s === null)
return _ConstructorForTypedArray(obj);
return ConstructorForTypedArray(obj);
// Step 7.
if (IsConstructor(s))
@ -1333,7 +1333,7 @@ function TypedArrayAt(index) {
// ES6 draft rev30 (2014/12/24) 22.2.3.30 %TypedArray%.prototype.values()
//
// Uncloned functions with `$` prefix are allocated as extended function
// to store the original name in `_SetCanonicalName`.
// to store the original name in `SetCanonicalName`.
function $TypedArrayValues() {
// Step 1.
var O = this;
@ -1344,7 +1344,7 @@ function $TypedArrayValues() {
// Step 7.
return CreateArrayIterator(O, ITEM_KIND_VALUE);
}
_SetCanonicalName($TypedArrayValues, "values");
SetCanonicalName($TypedArrayValues, "values");
// ES2021 draft rev 190d474c3d8728653fbf8a5a37db1de34b9c1472
// Plus <https://github.com/tc39/ecma262/pull/2221>
@ -1572,7 +1572,7 @@ function $TypedArraySpecies() {
// Step 1.
return this;
}
_SetCanonicalName($TypedArraySpecies, "get [Symbol.species]");
SetCanonicalName($TypedArraySpecies, "get [Symbol.species]");
// ES2018 draft rev 0525bb33861c7f4e9850f8a222c89642947c4b9c
// 22.2.2.1.1 Runtime Semantics: IterableToList( items, method )
@ -1606,7 +1606,7 @@ function IterableToList(items, method) {
// Step 4.b.
if (next.done)
break;
_DefineDataProperty(values, i++, next.value);
DefineDataProperty(values, i++, next.value);
}
// Step 5.
@ -1706,14 +1706,14 @@ function $ArrayBufferSpecies() {
// Step 1.
return this;
}
_SetCanonicalName($ArrayBufferSpecies, "get [Symbol.species]");
SetCanonicalName($ArrayBufferSpecies, "get [Symbol.species]");
// Shared memory and atomics proposal (30 Oct 2016)
function $SharedArrayBufferSpecies() {
// Step 1.
return this;
}
_SetCanonicalName($SharedArrayBufferSpecies, "get [Symbol.species]");
SetCanonicalName($SharedArrayBufferSpecies, "get [Symbol.species]");
// ES2020 draft rev dc1e21c454bd316810be1c0e7af0131a2d7f38e9
// 24.2.4.3 SharedArrayBuffer.prototype.slice ( start, end )

Просмотреть файл

@ -189,7 +189,7 @@ function CopyDataProperties(target, source, excludedItems) {
if (!hasOwn(key, excludedItems) &&
callFunction(std_Object_propertyIsEnumerable, from, key))
{
_DefineDataProperty(target, key, from[key]);
DefineDataProperty(target, key, from[key]);
}
}
@ -225,7 +225,7 @@ function CopyDataPropertiesUnfiltered(target, source) {
// We abbreviate this by calling propertyIsEnumerable which is faster
// and returns false for not defined properties.
if (callFunction(std_Object_propertyIsEnumerable, from, key))
_DefineDataProperty(target, key, from[key]);
DefineDataProperty(target, key, from[key]);
}
// Step 7 (Return).

Просмотреть файл

@ -345,7 +345,7 @@ function createCollatorCompare(collator) {
* Spec: ECMAScript Internationalization API Specification, 10.3.3.
*/
// Uncloned functions with `$` prefix are allocated as extended function
// to store the original name in `_SetCanonicalName`.
// to store the original name in `SetCanonicalName`.
function $Intl_Collator_compare_get() {
// Step 1.
var collator = this;
@ -365,7 +365,7 @@ function $Intl_Collator_compare_get() {
// Step 5.
return internals.boundCompare;
}
_SetCanonicalName($Intl_Collator_compare_get, "get compare");
SetCanonicalName($Intl_Collator_compare_get, "get compare");
/**
* Returns the resolved options for a Collator object.

Просмотреть файл

@ -209,7 +209,7 @@ function CanonicalizeLocaleList(locales) {
// Step 7.c.v.
if (callFunction(ArrayIndexOf, seen, tag) === -1)
_DefineDataProperty(seen, seen.length, tag);
DefineDataProperty(seen, seen.length, tag);
}
// Step 7.d.
@ -558,7 +558,7 @@ function LookupSupportedLocales(availableLocales, requestedLocales) {
// Step 2.c.
if (availableLocale !== undefined)
_DefineDataProperty(subset, subset.length, locale);
DefineDataProperty(subset, subset.length, locale);
}
// Step 3.

Просмотреть файл

@ -446,7 +446,7 @@ function InitializeDateTimeFormat(dateTimeFormat, thisValue, locales, options, m
if (dateTimeFormat !== thisValue &&
callFunction(std_Object_isPrototypeOf, GetBuiltinPrototype("DateTimeFormat"), thisValue))
{
_DefineDataProperty(thisValue, intlFallbackSymbol(), dateTimeFormat,
DefineDataProperty(thisValue, intlFallbackSymbol(), dateTimeFormat,
ATTR_NONENUMERABLE | ATTR_NONCONFIGURABLE | ATTR_NONWRITABLE);
return thisValue;
@ -755,17 +755,17 @@ function ToDateTimeOptions(options, required, defaults) {
// the Throw parameter, while Object.defineProperty uses true. For the
// calls here, the difference doesn't matter because we're adding
// properties to a new object.
_DefineDataProperty(options, "year", "numeric");
_DefineDataProperty(options, "month", "numeric");
_DefineDataProperty(options, "day", "numeric");
DefineDataProperty(options, "year", "numeric");
DefineDataProperty(options, "month", "numeric");
DefineDataProperty(options, "day", "numeric");
}
// Step 7.
if (needDefaults && (defaults === "time" || defaults === "all")) {
// See comment for step 7.
_DefineDataProperty(options, "hour", "numeric");
_DefineDataProperty(options, "minute", "numeric");
_DefineDataProperty(options, "second", "numeric");
DefineDataProperty(options, "hour", "numeric");
DefineDataProperty(options, "minute", "numeric");
DefineDataProperty(options, "second", "numeric");
}
// Step 8.
@ -850,7 +850,7 @@ function createDateTimeFormatFormat(dtf) {
* Spec: ECMAScript Internationalization API Specification, 12.4.3.
*/
// Uncloned functions with `$` prefix are allocated as extended function
// to store the original name in `_SetCanonicalName`.
// to store the original name in `SetCanonicalName`.
function $Intl_DateTimeFormat_format_get() {
// Steps 1-3.
var thisArg = UnwrapDateTimeFormat(this);
@ -871,7 +871,7 @@ function $Intl_DateTimeFormat_format_get() {
// Step 5.
return internals.boundFormat;
}
_SetCanonicalName($Intl_DateTimeFormat_format_get, "get format");
SetCanonicalName($Intl_DateTimeFormat_format_get, "get format");
/**
* Intl.DateTimeFormat.prototype.formatToParts ( date )
@ -1001,7 +1001,7 @@ function Intl_DateTimeFormat_resolvedOptions() {
};
if (internals.patternOption !== undefined) {
_DefineDataProperty(result, "pattern", internals.pattern);
DefineDataProperty(result, "pattern", internals.pattern);
}
var hasDateStyle = internals.dateStyle !== undefined;
@ -1014,10 +1014,10 @@ function Intl_DateTimeFormat_resolvedOptions() {
resolveICUPattern(internals.pattern, result, /* includeDateTimeFields = */ false);
}
if (hasDateStyle) {
_DefineDataProperty(result, "dateStyle", internals.dateStyle);
DefineDataProperty(result, "dateStyle", internals.dateStyle);
}
if (hasTimeStyle) {
_DefineDataProperty(result, "timeStyle", internals.timeStyle);
DefineDataProperty(result, "timeStyle", internals.timeStyle);
}
} else {
resolveICUPattern(internals.pattern, result, /* includeDateTimeFields = */ true);
@ -1171,44 +1171,44 @@ function resolveICUPattern(pattern, result, includeDateTimeFields) {
}
if (hourCycle) {
_DefineDataProperty(result, "hourCycle", hourCycle);
_DefineDataProperty(result, "hour12", hourCycle === "h11" || hourCycle === "h12");
DefineDataProperty(result, "hourCycle", hourCycle);
DefineDataProperty(result, "hour12", hourCycle === "h11" || hourCycle === "h12");
}
if (!includeDateTimeFields) {
return;
}
if (weekday) {
_DefineDataProperty(result, "weekday", weekday);
DefineDataProperty(result, "weekday", weekday);
}
if (era) {
_DefineDataProperty(result, "era", era);
DefineDataProperty(result, "era", era);
}
if (year) {
_DefineDataProperty(result, "year", year);
DefineDataProperty(result, "year", year);
}
if (month) {
_DefineDataProperty(result, "month", month);
DefineDataProperty(result, "month", month);
}
if (day) {
_DefineDataProperty(result, "day", day);
DefineDataProperty(result, "day", day);
}
if (dayPeriod) {
_DefineDataProperty(result, "dayPeriod", dayPeriod);
DefineDataProperty(result, "dayPeriod", dayPeriod);
}
if (hour) {
_DefineDataProperty(result, "hour", hour);
DefineDataProperty(result, "hour", hour);
}
if (minute) {
_DefineDataProperty(result, "minute", minute);
DefineDataProperty(result, "minute", minute);
}
if (second) {
_DefineDataProperty(result, "second", second);
DefineDataProperty(result, "second", second);
}
if (fractionalSecondDigits) {
_DefineDataProperty(result, "fractionalSecondDigits", fractionalSecondDigits);
DefineDataProperty(result, "fractionalSecondDigits", fractionalSecondDigits);
}
if (timeZoneName) {
_DefineDataProperty(result, "timeZoneName", timeZoneName);
DefineDataProperty(result, "timeZoneName", timeZoneName);
}
}
/* eslint-enable complexity */

Просмотреть файл

@ -294,11 +294,11 @@ function Intl_DisplayNames_resolvedOptions() {
"languageDisplay is present iff type is 'language'");
if (hasOwn("languageDisplay", internals)) {
_DefineDataProperty(options, "languageDisplay", internals.languageDisplay);
DefineDataProperty(options, "languageDisplay", internals.languageDisplay);
}
if (hasOwn("calendar", internals)) {
_DefineDataProperty(options, "calendar", internals.calendar);
DefineDataProperty(options, "calendar", internals.calendar);
}
// Step 6.

Просмотреть файл

@ -63,8 +63,8 @@ function Intl_getCalendarInfo(locales) {
// 6. Let result be GetCalendarInfo(r.[[locale]]).
const result = intl_GetCalendarInfo(r.locale);
_DefineDataProperty(result, "calendar", r.ca);
_DefineDataProperty(result, "locale", r.locale);
DefineDataProperty(result, "calendar", r.ca);
DefineDataProperty(result, "locale", r.locale);
// 7. Return result.
return result;
@ -162,7 +162,7 @@ function Intl_getDisplayNames(locales, options) {
for (let i = 0; i < len; i++) {
// a. Let processedKey be ? ToString(? Get(keys, i)).
// b. Perform ? CreateDataPropertyOrThrow(processedKeys, i, processedKey).
_DefineDataProperty(processedKeys, i, ToString(keys[i]));
DefineDataProperty(processedKeys, i, ToString(keys[i]));
}
// 16. Let names be ? ComputeDisplayNames(r.[[locale]], style, processedKeys).
@ -183,7 +183,7 @@ function Intl_getDisplayNames(locales, options) {
// d. Assert: the length of name is greater than zero.
assert(name.length > 0, "empty string value");
// e. Perform ? DefinePropertyOrThrow(values, key, name).
_DefineDataProperty(values, key, name);
DefineDataProperty(values, key, name);
}
// 20. Let options be ObjectCreate(%ObjectPrototype%).

Просмотреть файл

@ -180,7 +180,7 @@ function StringListFromIterable(iterable, methodName) {
}
// Step 5.b.iii.
_DefineDataProperty(list, list.length, element);
DefineDataProperty(list, list.length, element);
}
// Step 6.

Просмотреть файл

@ -531,8 +531,8 @@ function InitializeNumberFormat(numberFormat, thisValue, locales, options) {
if (numberFormat !== thisValue &&
callFunction(std_Object_isPrototypeOf, GetBuiltinPrototype("NumberFormat"), thisValue))
{
_DefineDataProperty(thisValue, intlFallbackSymbol(), numberFormat,
ATTR_NONENUMERABLE | ATTR_NONCONFIGURABLE | ATTR_NONWRITABLE);
DefineDataProperty(thisValue, intlFallbackSymbol(), numberFormat,
ATTR_NONENUMERABLE | ATTR_NONCONFIGURABLE | ATTR_NONWRITABLE);
return thisValue;
}
@ -632,7 +632,7 @@ function createNumberFormatFormat(nf) {
* Spec: ECMAScript Internationalization API Specification, 11.4.3.
*/
// Uncloned functions with `$` prefix are allocated as extended function
// to store the original name in `_SetCanonicalName`.
// to store the original name in `SetCanonicalName`.
function $Intl_NumberFormat_format_get() {
// Steps 1-3.
var thisArg = UnwrapNumberFormat(this);
@ -653,7 +653,7 @@ function $Intl_NumberFormat_format_get() {
// Step 5.
return internals.boundFormat;
}
_SetCanonicalName($Intl_NumberFormat_format_get, "get format");
SetCanonicalName($Intl_NumberFormat_format_get, "get format");
/**
* 11.4.4 Intl.NumberFormat.prototype.formatToParts ( value )
@ -708,9 +708,9 @@ function Intl_NumberFormat_resolvedOptions() {
"currencySign is present iff style is 'currency'");
if (hasOwn("currency", internals)) {
_DefineDataProperty(result, "currency", internals.currency);
_DefineDataProperty(result, "currencyDisplay", internals.currencyDisplay);
_DefineDataProperty(result, "currencySign", internals.currencySign);
DefineDataProperty(result, "currency", internals.currency);
DefineDataProperty(result, "currencyDisplay", internals.currencyDisplay);
DefineDataProperty(result, "currencySign", internals.currencySign);
}
// unit and unitDisplay are only present for unit formatters.
@ -720,11 +720,11 @@ function Intl_NumberFormat_resolvedOptions() {
"unitDisplay is present iff style is 'unit'");
if (hasOwn("unit", internals)) {
_DefineDataProperty(result, "unit", internals.unit);
_DefineDataProperty(result, "unitDisplay", internals.unitDisplay);
DefineDataProperty(result, "unit", internals.unit);
DefineDataProperty(result, "unitDisplay", internals.unitDisplay);
}
_DefineDataProperty(result, "minimumIntegerDigits", internals.minimumIntegerDigits);
DefineDataProperty(result, "minimumIntegerDigits", internals.minimumIntegerDigits);
// Min/Max fraction digits are either both present or not present at all.
assert(hasOwn("minimumFractionDigits", internals) ===
@ -732,8 +732,8 @@ function Intl_NumberFormat_resolvedOptions() {
"minimumFractionDigits is present iff maximumFractionDigits is present");
if (hasOwn("minimumFractionDigits", internals)) {
_DefineDataProperty(result, "minimumFractionDigits", internals.minimumFractionDigits);
_DefineDataProperty(result, "maximumFractionDigits", internals.maximumFractionDigits);
DefineDataProperty(result, "minimumFractionDigits", internals.minimumFractionDigits);
DefineDataProperty(result, "maximumFractionDigits", internals.maximumFractionDigits);
}
// Min/Max significant digits are either both present or not present at all.
@ -742,21 +742,21 @@ function Intl_NumberFormat_resolvedOptions() {
"minimumSignificantDigits is present iff maximumSignificantDigits is present");
if (hasOwn("minimumSignificantDigits", internals)) {
_DefineDataProperty(result, "minimumSignificantDigits",
internals.minimumSignificantDigits);
_DefineDataProperty(result, "maximumSignificantDigits",
internals.maximumSignificantDigits);
DefineDataProperty(result, "minimumSignificantDigits",
internals.minimumSignificantDigits);
DefineDataProperty(result, "maximumSignificantDigits",
internals.maximumSignificantDigits);
}
_DefineDataProperty(result, "useGrouping", internals.useGrouping);
DefineDataProperty(result, "useGrouping", internals.useGrouping);
var notation = internals.notation;
_DefineDataProperty(result, "notation", notation);
DefineDataProperty(result, "notation", notation);
if (notation === "compact")
_DefineDataProperty(result, "compactDisplay", internals.compactDisplay);
DefineDataProperty(result, "compactDisplay", internals.compactDisplay);
_DefineDataProperty(result, "signDisplay", internals.signDisplay);
DefineDataProperty(result, "signDisplay", internals.signDisplay);
// Step 6.
return result;

Просмотреть файл

@ -236,8 +236,8 @@ function Intl_PluralRules_resolvedOptions() {
"minimumFractionDigits is present iff maximumFractionDigits is present");
if (hasOwn("minimumFractionDigits", internals)) {
_DefineDataProperty(result, "minimumFractionDigits", internals.minimumFractionDigits);
_DefineDataProperty(result, "maximumFractionDigits", internals.maximumFractionDigits);
DefineDataProperty(result, "minimumFractionDigits", internals.minimumFractionDigits);
DefineDataProperty(result, "maximumFractionDigits", internals.maximumFractionDigits);
}
// Min/Max significant digits are either both present or not present at all.
@ -246,10 +246,10 @@ function Intl_PluralRules_resolvedOptions() {
"minimumSignificantDigits is present iff maximumSignificantDigits is present");
if (hasOwn("minimumSignificantDigits", internals)) {
_DefineDataProperty(result, "minimumSignificantDigits",
internals.minimumSignificantDigits);
_DefineDataProperty(result, "maximumSignificantDigits",
internals.maximumSignificantDigits);
DefineDataProperty(result, "minimumSignificantDigits",
internals.minimumSignificantDigits);
DefineDataProperty(result, "maximumSignificantDigits",
internals.maximumSignificantDigits);
}
// Step 6.
@ -261,10 +261,10 @@ function Intl_PluralRules_resolvedOptions() {
var pluralCategories = [];
for (var i = 0; i < internalsPluralCategories.length; i++)
_DefineDataProperty(pluralCategories, i, internalsPluralCategories[i]);
DefineDataProperty(pluralCategories, i, internalsPluralCategories[i]);
// Step 7.
_DefineDataProperty(result, "pluralCategories", pluralCategories);
DefineDataProperty(result, "pluralCategories", pluralCategories);
// Step 8.
return result;

Просмотреть файл

@ -7703,7 +7703,7 @@ bool BytecodeEmitter::emitSelfHostedSetIsInlinableLargeFunction(
ListNode* argsList = &callNode->right()->as<ListNode>();
if (argsList->count() != 1) {
reportNeedMoreArgsError(callNode, "_SetIsInlinableLargeFunction", "1", "",
reportNeedMoreArgsError(callNode, "SetIsInlinableLargeFunction", "1", "",
argsList);
return false;
}
@ -7725,7 +7725,7 @@ bool BytecodeEmitter::emitSelfHostedSetCanonicalName(BinaryNode* callNode) {
ListNode* argsList = &callNode->right()->as<ListNode>();
if (argsList->count() != 2) {
reportNeedMoreArgsError(callNode, "_SetCanonicalName", "2", "s", argsList);
reportNeedMoreArgsError(callNode, "SetCanonicalName", "2", "s", argsList);
return false;
}

Просмотреть файл

@ -18,7 +18,7 @@ function test() {
// below can get into the megamorphic state.
Object.defineProperty(obj, "bar" + i, nonEnumerableProperty);
// Plain data property, will be created through _DefineDataProperty,
// Plain data property, will be created through DefineDataProperty,
// which is emitted as JSOP_INITELEM. The object doesn't have a "foo"
// property, so JSOP_INITELEM can simply create a new property.
Object.defineProperty(obj, "foo", plainDataProperty);

Просмотреть файл

@ -1,4 +1,4 @@
var isConstructing = getSelfHostedValue("_IsConstructing");
var isConstructing = getSelfHostedValue("IsConstructing");
function testBasic() {
var f = function(expected) {

Просмотреть файл

@ -415,10 +415,10 @@
MACRO_(set, set, "set") \
MACRO_(setBigInt64, setBigInt64, "setBigInt64") \
MACRO_(setBigUint64, setBigUint64, "setBigUint64") \
MACRO_(SetCanonicalName, SetCanonicalName, "_SetCanonicalName") \
MACRO_(SetCanonicalName, SetCanonicalName, "SetCanonicalName") \
MACRO_(SetConstructorInit, SetConstructorInit, "SetConstructorInit") \
MACRO_(SetIsInlinableLargeFunction, SetIsInlinableLargeFunction, \
"_SetIsInlinableLargeFunction") \
"SetIsInlinableLargeFunction") \
MACRO_(SetIterator, SetIterator, "Set Iterator") \
MACRO_(setPrototypeOf, setPrototypeOf, "setPrototypeOf") \
MACRO_(shape, shape, "shape") \
@ -547,7 +547,7 @@
MACRO_(symbol, symbol, "symbol") \
MACRO_(bigint, bigint, "bigint") \
MACRO_(defineDataPropertyIntrinsic, defineDataPropertyIntrinsic, \
"_DefineDataProperty")
"DefineDataProperty")
#define PROPERTY_NAME_IGNORE(IDPART, ID, TEXT)

Просмотреть файл

@ -549,7 +549,7 @@ static bool intrinsic_DefineDataProperty(JSContext* cx, unsigned argc,
MOZ_ASSERT(bool(attributes & ATTR_ENUMERABLE) !=
bool(attributes & ATTR_NONENUMERABLE),
"_DefineDataProperty must receive either ATTR_ENUMERABLE xor "
"DefineDataProperty must receive either ATTR_ENUMERABLE xor "
"ATTR_NONENUMERABLE");
if (attributes & ATTR_ENUMERABLE) {
attrs += JS::PropertyAttribute::Enumerable;
@ -557,7 +557,7 @@ static bool intrinsic_DefineDataProperty(JSContext* cx, unsigned argc,
MOZ_ASSERT(bool(attributes & ATTR_CONFIGURABLE) !=
bool(attributes & ATTR_NONCONFIGURABLE),
"_DefineDataProperty must receive either ATTR_CONFIGURABLE xor "
"DefineDataProperty must receive either ATTR_CONFIGURABLE xor "
"ATTR_NONCONFIGURABLE");
if (attributes & ATTR_CONFIGURABLE) {
attrs += JS::PropertyAttribute::Configurable;
@ -565,7 +565,7 @@ static bool intrinsic_DefineDataProperty(JSContext* cx, unsigned argc,
MOZ_ASSERT(
bool(attributes & ATTR_WRITABLE) != bool(attributes & ATTR_NONWRITABLE),
"_DefineDataProperty must receive either ATTR_WRITABLE xor "
"DefineDataProperty must receive either ATTR_WRITABLE xor "
"ATTR_NONWRITABLE");
if (attributes & ATTR_WRITABLE) {
attrs += JS::PropertyAttribute::Writable;
@ -2182,7 +2182,7 @@ static const JSFunctionSpec intrinsic_functions[] = {
IntrinsicIsCallable),
JS_INLINABLE_FN("IsConstructor", intrinsic_IsConstructor, 1, 0,
IntrinsicIsConstructor),
JS_FN("_ConstructFunction", intrinsic_ConstructFunction, 2, 0),
JS_FN("ConstructFunction", intrinsic_ConstructFunction, 2, 0),
JS_FN("ThrowRangeError", intrinsic_ThrowRangeError, 4, 0),
JS_FN("ThrowTypeError", intrinsic_ThrowTypeError, 4, 0),
JS_FN("ThrowSyntaxError", intrinsic_ThrowSyntaxError, 4, 0),
@ -2192,19 +2192,18 @@ static const JSFunctionSpec intrinsic_functions[] = {
JS_FN("CreateModuleSyntaxError", intrinsic_CreateModuleSyntaxError, 4, 0),
JS_FN("AssertionFailed", intrinsic_AssertionFailed, 1, 0),
JS_FN("DumpMessage", intrinsic_DumpMessage, 1, 0),
JS_FN("_ConstructorForTypedArray", intrinsic_ConstructorForTypedArray, 1,
0),
JS_FN("ConstructorForTypedArray", intrinsic_ConstructorForTypedArray, 1, 0),
JS_FN("DecompileArg", intrinsic_DecompileArg, 2, 0),
JS_INLINABLE_FN("_FinishBoundFunctionInit",
JS_INLINABLE_FN("FinishBoundFunctionInit",
intrinsic_FinishBoundFunctionInit, 3, 0,
IntrinsicFinishBoundFunctionInit),
JS_FN("_DefineDataProperty", intrinsic_DefineDataProperty, 4, 0),
JS_FN("_DefineProperty", intrinsic_DefineProperty, 6, 0),
JS_FN("DefineDataProperty", intrinsic_DefineDataProperty, 4, 0),
JS_FN("DefineProperty", intrinsic_DefineProperty, 6, 0),
JS_FN("CopyDataPropertiesOrGetOwnKeys",
intrinsic_CopyDataPropertiesOrGetOwnKeys, 3, 0),
JS_INLINABLE_FN("SameValue", js::obj_is, 2, 0, ObjectIs),
JS_INLINABLE_FN("_IsConstructing", intrinsic_IsConstructing, 0, 0,
JS_INLINABLE_FN("IsConstructing", intrinsic_IsConstructing, 0, 0,
IntrinsicIsConstructing),
JS_INLINABLE_FN("SubstringKernel", intrinsic_SubstringKernel, 3, 0,
IntrinsicSubstringKernel),
@ -2260,17 +2259,16 @@ static const JSFunctionSpec intrinsic_functions[] = {
intrinsic_GuardToBuiltin<RegExpStringIteratorObject>, 1, 0,
IntrinsicGuardToRegExpStringIterator),
JS_FN("_CreateMapIterationResultPair",
JS_FN("CreateMapIterationResultPair",
intrinsic_CreateMapIterationResultPair, 0, 0),
JS_INLINABLE_FN("_GetNextMapEntryForIterator",
JS_INLINABLE_FN("GetNextMapEntryForIterator",
intrinsic_GetNextMapEntryForIterator, 2, 0,
IntrinsicGetNextMapEntryForIterator),
JS_FN("CallMapIteratorMethodIfWrapped",
CallNonGenericSelfhostedMethod<Is<MapIteratorObject>>, 2, 0),
JS_FN("_CreateSetIterationResult", intrinsic_CreateSetIterationResult, 0,
0),
JS_INLINABLE_FN("_GetNextSetEntryForIterator",
JS_FN("CreateSetIterationResult", intrinsic_CreateSetIterationResult, 0, 0),
JS_INLINABLE_FN("GetNextSetEntryForIterator",
intrinsic_GetNextSetEntryForIterator, 2, 0,
IntrinsicGetNextSetEntryForIterator),
JS_FN("CallSetIteratorMethodIfWrapped",