Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (254417 => 254418)
--- trunk/Source/_javascript_Core/ChangeLog 2020-01-13 00:21:42 UTC (rev 254417)
+++ trunk/Source/_javascript_Core/ChangeLog 2020-01-13 01:18:45 UTC (rev 254418)
@@ -1,5 +1,83 @@
2020-01-12 Yusuke Suzuki <[email protected]>
+ [JSC] Consistently use "var" in builtin JS
+ https://bugs.webkit.org/show_bug.cgi?id=206157
+
+ Reviewed by Mark Lam.
+
+ let / const requires additional bytecode to make it Empty initialized for now.
+ For builtin JS, we would like to keep it as efficient and compact as we can
+ so we should use `var` consistently.
+
+ * builtins/ArrayPrototype.js:
+ (sort.stringComparator):
+ (sort.compactSparse):
+ (sort.compactSlow):
+ (sort.compact):
+ (sort.merge):
+ (sort.mergeSort):
+ (sort.bucketSort):
+ (sort.comparatorSort):
+ (sort.stringSort):
+ (sort):
+ (globalPrivate.concatSlowPath):
+ (concat):
+ * builtins/FunctionPrototype.js:
+ (call):
+ (overriddenName.string_appeared_here.symbolHasInstance):
+ * builtins/GlobalOperations.js:
+ (globalPrivate.copyDataProperties):
+ (globalPrivate.copyDataPropertiesNoExclusions):
+ * builtins/IteratorHelpers.js:
+ (performIteration):
+ * builtins/ModuleLoader.js:
+ (async loadModule):
+ (async loadAndEvaluateModule):
+ (async requestImportModule):
+ (dependencyKeysIfEvaluated):
+ * builtins/ObjectConstructor.js:
+ (fromEntries):
+ * builtins/PromisePrototype.js:
+ (finally):
+ (valueThunk):
+ (globalPrivate.getThenFinally):
+ (thrower):
+ (globalPrivate.getCatchFinally):
+ (const.valueThunk): Deleted.
+ (const.thrower): Deleted.
+ * builtins/RegExpPrototype.js:
+ (globalPrivate.advanceStringIndex):
+ (globalPrivate.regExpExec):
+ (globalPrivate.hasObservableSideEffectsForRegExpMatch):
+ (globalPrivate.matchSlow):
+ (overriddenName.string_appeared_here.match):
+ (overriddenName.string_appeared_here.matchAll):
+ (getSubstitution):
+ (overriddenName.string_appeared_here.replace):
+ (overriddenName.string_appeared_here.search):
+ (globalPrivate.hasObservableSideEffectsForRegExpSplit):
+ (overriddenName.string_appeared_here.split):
+ (intrinsic.RegExpTestIntrinsic.test):
+ * builtins/RegExpStringIteratorPrototype.js:
+ (next):
+ * builtins/StringPrototype.js:
+ (match):
+ (matchAll):
+ (globalPrivate.hasObservableSideEffectsForStringReplace):
+ (intrinsic.StringPrototypeReplaceIntrinsic.replace):
+ (globalPrivate.createHTML):
+ * builtins/TypedArrayConstructor.js:
+ (of):
+ (from):
+ * builtins/TypedArrayPrototype.js:
+ (globalPrivate.typedArraySpeciesConstructor):
+ (globalPrivate.typedArrayClampArgumentToStartOrEnd):
+ (fill):
+ (find):
+ (subarray):
+
+2020-01-12 Yusuke Suzuki <[email protected]>
+
[WebCore] Reorganize JSType in WebCore to offer more bits to JSC
https://bugs.webkit.org/show_bug.cgi?id=206141
Modified: trunk/Source/_javascript_Core/builtins/ArrayPrototype.js (254417 => 254418)
--- trunk/Source/_javascript_Core/builtins/ArrayPrototype.js 2020-01-13 00:21:42 UTC (rev 254417)
+++ trunk/Source/_javascript_Core/builtins/ArrayPrototype.js 2020-01-13 01:18:45 UTC (rev 254418)
@@ -317,16 +317,16 @@
function stringComparator(a, b)
{
- let aString = a.string;
- let bString = b.string;
+ var aString = a.string;
+ var bString = b.string;
- let aLength = aString.length;
- let bLength = bString.length;
- let length = min(aLength, bLength);
+ var aLength = aString.length;
+ var bLength = bString.length;
+ var length = min(aLength, bLength);
- for (let i = 0; i < length; ++i) {
- let aCharCode = aString.@charCodeAt(i);
- let bCharCode = bString.@charCodeAt(i);
+ for (var i = 0; i < length; ++i) {
+ var aCharCode = aString.@charCodeAt(i);
+ var bCharCode = bString.@charCodeAt(i);
if (aCharCode == bCharCode)
continue;
@@ -340,25 +340,25 @@
// Move undefineds and holes to the end of a sparse array. Result is [values..., undefineds..., holes...].
function compactSparse(array, dst, src, length)
{
- let values = [ ];
- let seen = { };
- let valueCount = 0;
- let undefinedCount = 0;
+ var values = [ ];
+ var seen = { };
+ var valueCount = 0;
+ var undefinedCount = 0;
// Clean up after the in-progress non-sparse compaction that failed.
- for (let i = dst; i < src; ++i)
+ for (var i = dst; i < src; ++i)
delete array[i];
- for (let object = array; object; object = @Object.@getPrototypeOf(object)) {
- let propertyNames = @Object.@getOwnPropertyNames(object);
- for (let i = 0; i < propertyNames.length; ++i) {
- let index = propertyNames[i];
+ for (var object = array; object; object = @Object.@getPrototypeOf(object)) {
+ var propertyNames = @Object.@getOwnPropertyNames(object);
+ for (var i = 0; i < propertyNames.length; ++i) {
+ var index = propertyNames[i];
if (index < length) { // Exclude non-numeric properties and properties past length.
if (seen[index]) // Exclude duplicates.
continue;
seen[index] = 1;
- let value = array[index];
+ var value = array[index];
delete array[index];
if (value === @undefined) {
@@ -371,7 +371,7 @@
}
}
- for (let i = valueCount; i < valueCount + undefinedCount; ++i)
+ for (var i = valueCount; i < valueCount + undefinedCount; ++i)
array[i] = @undefined;
return valueCount;
@@ -379,10 +379,10 @@
function compactSlow(array, length)
{
- let holeCount = 0;
+ var holeCount = 0;
- let dst = 0;
- let src = ""
+ var dst = 0;
+ var src = ""
for (; src < length; ++src) {
if (!(src in array)) {
++holeCount;
@@ -391,7 +391,7 @@
return compactSparse(array, dst, src, length);
}
- let value = array[src];
+ var value = array[src];
if (value === @undefined)
continue;
@@ -398,13 +398,13 @@
array[dst++] = value;
}
- let valueCount = dst;
- let undefinedCount = length - valueCount - holeCount;
+ var valueCount = dst;
+ var undefinedCount = length - valueCount - holeCount;
- for (let i = valueCount; i < valueCount + undefinedCount; ++i)
+ for (var i = valueCount; i < valueCount + undefinedCount; ++i)
array[i] = @undefined;
- for (let i = valueCount + undefinedCount; i < length; ++i)
+ for (var i = valueCount + undefinedCount; i < length; ++i)
delete array[i];
return valueCount;
@@ -413,7 +413,7 @@
// Move undefineds and holes to the end of an array. Result is [values..., undefineds..., holes...].
function compact(array, length)
{
- for (let i = 0; i < array.length; ++i) {
+ for (var i = 0; i < array.length; ++i) {
if (array[i] === @undefined)
return compactSlow(array, length);
}
@@ -423,12 +423,12 @@
function merge(dst, src, srcIndex, srcEnd, width, comparator)
{
- let left = srcIndex;
- let leftEnd = min(left + width, srcEnd);
- let right = leftEnd;
- let rightEnd = min(right + width, srcEnd);
+ var left = srcIndex;
+ var leftEnd = min(left + width, srcEnd);
+ var right = leftEnd;
+ var rightEnd = min(right + width, srcEnd);
- for (let dstIndex = left; dstIndex < rightEnd; ++dstIndex) {
+ for (var dstIndex = left; dstIndex < rightEnd; ++dstIndex) {
if (right < rightEnd) {
if (left >= leftEnd) {
dst[dstIndex] = src[right++];
@@ -435,7 +435,7 @@
continue;
}
- let comparisonResult = comparator(src[right], src[left]);
+ var comparisonResult = comparator(src[right], src[left]);
if ((typeof comparisonResult === "boolean" && !comparisonResult) || comparisonResult < 0) {
dst[dstIndex] = src[right++];
continue;
@@ -449,22 +449,22 @@
function mergeSort(array, valueCount, comparator)
{
- let buffer = [ ];
+ var buffer = [ ];
buffer.length = valueCount;
- let dst = buffer;
- let src = ""
- for (let width = 1; width < valueCount; width *= 2) {
- for (let srcIndex = 0; srcIndex < valueCount; srcIndex += 2 * width)
+ var dst = buffer;
+ var src = ""
+ for (var width = 1; width < valueCount; width *= 2) {
+ for (var srcIndex = 0; srcIndex < valueCount; srcIndex += 2 * width)
merge(dst, src, srcIndex, valueCount, width, comparator);
- let tmp = src;
+ var tmp = src;
src = ""
dst = tmp;
}
if (src != array) {
- for(let i = 0; i < valueCount; i++)
+ for(var i = 0; i < valueCount; i++)
array[i] = src[i];
}
}
@@ -473,27 +473,27 @@
{
if (bucket.length < 32 || depth > 32) {
mergeSort(bucket, bucket.length, stringComparator);
- for (let i = 0; i < bucket.length; ++i)
+ for (var i = 0; i < bucket.length; ++i)
array[dst++] = bucket[i].value;
return dst;
}
- let buckets = [ ];
- for (let i = 0; i < bucket.length; ++i) {
- let entry = bucket[i];
- let string = entry.string;
+ var buckets = [ ];
+ for (var i = 0; i < bucket.length; ++i) {
+ var entry = bucket[i];
+ var string = entry.string;
if (string.length == depth) {
array[dst++] = entry.value;
continue;
}
- let c = string.@charCodeAt(depth);
+ var c = string.@charCodeAt(depth);
if (!buckets[c])
buckets[c] = [ ];
buckets[c][buckets[c].length] = entry;
}
- for (let i = 0; i < buckets.length; ++i) {
+ for (var i = 0; i < buckets.length; ++i) {
if (!buckets[i])
continue;
dst = bucketSort(array, dst, buckets[i], depth + 1);
@@ -504,22 +504,22 @@
function comparatorSort(array, length, comparator)
{
- let valueCount = compact(array, length);
+ var valueCount = compact(array, length);
mergeSort(array, valueCount, comparator);
}
function stringSort(array, length)
{
- let valueCount = compact(array, length);
+ var valueCount = compact(array, length);
- let strings = @newArrayWithSize(valueCount);
- for (let i = 0; i < valueCount; ++i)
+ var strings = @newArrayWithSize(valueCount);
+ for (var i = 0; i < valueCount; ++i)
strings[i] = { string: @toString(array[i]), value: array[i] };
bucketSort(array, 0, strings, 0);
}
- let sortFunction;
+ var sortFunction;
if (typeof comparator == "function")
sortFunction = comparatorSort;
else if (comparator === @undefined)
@@ -527,9 +527,9 @@
else
@throwTypeError("Array.prototype.sort requires the comparsion function be a function or undefined");
- let array = @toObject(this, "Array.prototype.sort requires that |this| not be null or undefined");
+ var array = @toObject(this, "Array.prototype.sort requires that |this| not be null or undefined");
- let length = @toLength(array.length);
+ var length = @toLength(array.length);
// For compatibility with Firefox and Chrome, do nothing observable
// to the target array if it has 0 or 1 sortable properties.
@@ -555,9 +555,9 @@
var argIndex = 0;
do {
- let spreadable = @isObject(currentElement) && currentElement.@isConcatSpreadableSymbol;
+ var spreadable = @isObject(currentElement) && currentElement.@isConcatSpreadableSymbol;
if ((spreadable === @undefined && @isArray(currentElement)) || spreadable) {
- let length = @toLength(currentElement.length);
+ var length = @toLength(currentElement.length);
if (length + resultIndex > @MAX_ARRAY_INDEX)
@throwRangeError("Length exceeded the maximum array length");
if (resultIsArray && @isJSArray(currentElement)) {
@@ -591,7 +591,7 @@
&& this.@isConcatSpreadableSymbol === @undefined
&& (!@isObject(first) || (!@isProxyObject(first) && first.@isConcatSpreadableSymbol === @undefined))) {
- let result = @concatMemcpy(this, first);
+ var result = @concatMemcpy(this, first);
if (result !== null)
return result;
}
Modified: trunk/Source/_javascript_Core/builtins/FunctionPrototype.js (254417 => 254418)
--- trunk/Source/_javascript_Core/builtins/FunctionPrototype.js 2020-01-13 00:21:42 UTC (rev 254417)
+++ trunk/Source/_javascript_Core/builtins/FunctionPrototype.js 2020-01-13 01:18:45 UTC (rev 254418)
@@ -27,9 +27,9 @@
{
"use strict";
- let argumentValues = [];
+ var argumentValues = [];
// Start from 1 to ignore thisArgument
- for (let i = 1; i < arguments.length; i++)
+ for (var i = 1; i < arguments.length; i++)
@putByValDirect(argumentValues, i-1, arguments[i]);
return this.@apply(thisArgument, argumentValues);
@@ -53,7 +53,7 @@
if (@isBoundFunction(this))
return @hasInstanceBoundFunction(this, value);
- let target = this.prototype;
+ var target = this.prototype;
return @instanceOf(value, target);
}
Modified: trunk/Source/_javascript_Core/builtins/GlobalOperations.js (254417 => 254418)
--- trunk/Source/_javascript_Core/builtins/GlobalOperations.js 2020-01-13 00:21:42 UTC (rev 254417)
+++ trunk/Source/_javascript_Core/builtins/GlobalOperations.js 2020-01-13 01:18:45 UTC (rev 254418)
@@ -95,14 +95,14 @@
if (@isUndefinedOrNull(source))
return target;
- let from = @toObject(source);
- let keys = @ownKeys(from);
- let keysLength = keys.length;
- for (let i = 0; i < keysLength; i++) {
- let nextKey = keys[i];
+ var from = @toObject(source);
+ var keys = @ownKeys(from);
+ var keysLength = keys.length;
+ for (var i = 0; i < keysLength; i++) {
+ var nextKey = keys[i];
if (!excludedSet.@has(nextKey)) {
if (@propertyIsEnumerable(from, nextKey)) {
- let propValue = from[nextKey];
+ var propValue = from[nextKey];
@defineEnumerableWritableConfigurableDataProperty(target, nextKey, propValue);
}
}
@@ -122,13 +122,13 @@
if (@isUndefinedOrNull(source))
return target;
- let from = @toObject(source);
- let keys = @ownKeys(from);
- let keysLength = keys.length;
- for (let i = 0; i < keysLength; i++) {
- let nextKey = keys[i];
+ var from = @toObject(source);
+ var keys = @ownKeys(from);
+ var keysLength = keys.length;
+ for (var i = 0; i < keysLength; i++) {
+ var nextKey = keys[i];
if (@propertyIsEnumerable(from, nextKey)) {
- let propValue = from[nextKey];
+ var propValue = from[nextKey];
@defineEnumerableWritableConfigurableDataProperty(target, nextKey, propValue);
}
}
Modified: trunk/Source/_javascript_Core/builtins/IteratorHelpers.js (254417 => 254418)
--- trunk/Source/_javascript_Core/builtins/IteratorHelpers.js 2020-01-13 00:21:42 UTC (rev 254417)
+++ trunk/Source/_javascript_Core/builtins/IteratorHelpers.js 2020-01-13 01:18:45 UTC (rev 254418)
@@ -30,12 +30,12 @@
// and returning the result in an array.
// https://tc39.github.io/ecma262/#sec-runtime-semantics-arrayaccumulation
- let result = [];
+ var result = [];
- let iterator = iterable.@iteratorSymbol();
- let next = iterator.next;
- let item;
- let index = 0;
+ var iterator = iterable.@iteratorSymbol();
+ var next = iterator.next;
+ var item;
+ var index = 0;
while (true) {
item = next.@call(iterator);
if (!@isObject(item))
Modified: trunk/Source/_javascript_Core/builtins/ModuleLoader.js (254417 => 254418)
--- trunk/Source/_javascript_Core/builtins/ModuleLoader.js 2020-01-13 00:21:42 UTC (rev 254417)
+++ trunk/Source/_javascript_Core/builtins/ModuleLoader.js 2020-01-13 01:18:45 UTC (rev 254418)
@@ -338,8 +338,8 @@
// resolve: moduleName => Promise(moduleKey)
// Take the name and resolve it to the unique identifier for the resource location.
// For example, take the "jquery" and return the URL for the resource.
- let key = await this.resolve(moduleName, @undefined, fetcher);
- let entry = await this.requestSatisfy(this.ensureRegistered(key), parameters, fetcher, new @Set);
+ var key = await this.resolve(moduleName, @undefined, fetcher);
+ var entry = await this.requestSatisfy(this.ensureRegistered(key), parameters, fetcher, new @Set);
return entry.key;
}
@@ -359,7 +359,7 @@
{
"use strict";
- let key = await this.loadModule(moduleName, parameters, fetcher);
+ var key = await this.loadModule(moduleName, parameters, fetcher);
return await this.linkAndEvaluateModule(key, fetcher);
}
@@ -367,7 +367,7 @@
{
"use strict";
- let entry = await this.requestSatisfy(this.ensureRegistered(key), parameters, fetcher, new @Set);
+ var entry = await this.requestSatisfy(this.ensureRegistered(key), parameters, fetcher, new @Set);
this.linkAndEvaluateModule(entry.key, fetcher);
return this.getModuleNamespaceObject(entry.module);
}
@@ -376,14 +376,14 @@
{
"use strict";
- let entry = this.registry.@get(key);
+ var entry = this.registry.@get(key);
if (!entry || !entry.evaluated)
return null;
- let dependencies = entry.dependencies;
- let length = dependencies.length;
- let result = new @Array(length);
- for (let i = 0; i < length; ++i)
+ var dependencies = entry.dependencies;
+ var length = dependencies.length;
+ var result = new @Array(length);
+ for (var i = 0; i < length; ++i)
result[i] = dependencies[i].key;
return result;
Modified: trunk/Source/_javascript_Core/builtins/ObjectConstructor.js (254417 => 254418)
--- trunk/Source/_javascript_Core/builtins/ObjectConstructor.js 2020-01-13 00:21:42 UTC (rev 254417)
+++ trunk/Source/_javascript_Core/builtins/ObjectConstructor.js 2020-01-13 01:18:45 UTC (rev 254418)
@@ -45,13 +45,13 @@
{
"use strict";
- let object = {};
+ var object = {};
- for (let entry of iterable) {
+ for (var entry of iterable) {
if (!@isObject(entry))
@throwTypeError("Object.fromEntries requires the first iterable parameter yields objects");
- let key = entry[0];
- let value = entry[1];
+ var key = entry[0];
+ var value = entry[1];
@putByValDirect(object, key, value);
}
Modified: trunk/Source/_javascript_Core/builtins/PromisePrototype.js (254417 => 254418)
--- trunk/Source/_javascript_Core/builtins/PromisePrototype.js 2020-01-13 00:21:42 UTC (rev 254417)
+++ trunk/Source/_javascript_Core/builtins/PromisePrototype.js 2020-01-13 01:18:45 UTC (rev 254418)
@@ -79,12 +79,12 @@
if (!@isObject(this))
@throwTypeError("|this| is not an object");
- const constructor = @speciesConstructor(this, @Promise);
+ var constructor = @speciesConstructor(this, @Promise);
@assert(@isConstructor(constructor));
- let thenFinally;
- let catchFinally;
+ var thenFinally;
+ var catchFinally;
if (typeof onFinally !== "function") {
thenFinally = onFinally;
@@ -105,15 +105,15 @@
return function(value)
{
@assert(typeof _onFinally_ === "function");
- const result = onFinally();
+ var result = onFinally();
@assert(@isConstructor(constructor));
- const resultCapability = @newPromiseCapability(constructor);
+ var resultCapability = @newPromiseCapability(constructor);
resultCapability.@resolve.@call(@undefined, result);
- const promise = resultCapability.@promise;
- const valueThunk = function () { return value; };
+ var promise = resultCapability.@promise;
+ var valueThunk = function () { return value; };
return promise.then(valueThunk);
}
@@ -127,15 +127,15 @@
return function(reason)
{
@assert(typeof _onFinally_ === "function");
- const result = onFinally();
+ var result = onFinally();
@assert(@isConstructor(constructor));
- const resultCapability = @newPromiseCapability(constructor);
+ var resultCapability = @newPromiseCapability(constructor);
resultCapability.@resolve.@call(@undefined, result);
- const promise = resultCapability.@promise;
- const thrower = function () { throw reason; };
+ var promise = resultCapability.@promise;
+ var thrower = function () { throw reason; };
return promise.then(thrower);
}
Modified: trunk/Source/_javascript_Core/builtins/RegExpPrototype.js (254417 => 254418)
--- trunk/Source/_javascript_Core/builtins/RegExpPrototype.js 2020-01-13 00:21:42 UTC (rev 254417)
+++ trunk/Source/_javascript_Core/builtins/RegExpPrototype.js 2020-01-13 01:18:45 UTC (rev 254418)
@@ -48,11 +48,11 @@
if (index + 1 >= string.length)
return index + 1;
- let first = string.@charCodeAt(index);
+ var first = string.@charCodeAt(index);
if (first < 0xD800 || first > 0xDBFF)
return index + 1;
- let second = string.@charCodeAt(index + 1);
+ var second = string.@charCodeAt(index + 1);
if (second < 0xDC00 || second > 0xDFFF)
return index + 1;
@@ -64,10 +64,10 @@
{
"use strict";
- let exec = regexp.exec;
- let builtinExec = @regExpBuiltinExec;
+ var exec = regexp.exec;
+ var builtinExec = @regExpBuiltinExec;
if (exec !== builtinExec && typeof exec === "function") {
- let result = exec.@call(regexp, str);
+ var result = exec.@call(regexp, str);
if (result !== null && !@isObject(result))
@throwTypeError("The result of a RegExp exec must be null or an object");
return result;
@@ -84,14 +84,14 @@
return true;
// This is accessed by the RegExpExec internal function.
- let regexpExec = @tryGetById(regexp, "exec");
+ var regexpExec = @tryGetById(regexp, "exec");
if (regexpExec !== @regExpBuiltinExec)
return true;
- let regexpGlobal = @tryGetById(regexp, "global");
+ var regexpGlobal = @tryGetById(regexp, "global");
if (regexpGlobal !== @regExpProtoGlobalGetter)
return true;
- let regexpUnicode = @tryGetById(regexp, "unicode");
+ var regexpUnicode = @tryGetById(regexp, "unicode");
if (regexpUnicode !== @regExpProtoUnicodeGetter)
return true;
@@ -106,17 +106,17 @@
if (!regexp.global)
return @regExpExec(regexp, str);
- let unicode = regexp.unicode;
+ var unicode = regexp.unicode;
regexp.lastIndex = 0;
- let resultList = [];
+ var resultList = [];
// FIXME: It would be great to implement a solution similar to what we do in
// RegExpObject::matchGlobal(). It's not clear if this is possible, since this loop has
// effects. https://bugs.webkit.org/show_bug.cgi?id=158145
- const maximumReasonableMatchSize = 100000000;
+ var maximumReasonableMatchSize = 100000000;
while (true) {
- let result = @regExpExec(regexp, str);
+ var result = @regExpExec(regexp, str);
if (result === null) {
if (resultList.length === 0)
@@ -127,7 +127,7 @@
if (resultList.length > maximumReasonableMatchSize)
@throwOutOfMemoryError();
- let resultString = @toString(result[0]);
+ var resultString = @toString(result[0]);
if (!resultString.length)
regexp.lastIndex = @advanceStringIndex(str, regexp.lastIndex, unicode);
@@ -144,7 +144,7 @@
if (!@isObject(this))
@throwTypeError("RegExp.prototype.@@match requires that |this| be an Object");
- let str = @toString(strArg);
+ var str = @toString(strArg);
// Check for observable side effects and call the fast path if there aren't any.
if (!@hasObservableSideEffectsForRegExpMatch(this))
@@ -157,19 +157,19 @@
{
"use strict";
- let regExp = this;
+ var regExp = this;
if (!@isObject(regExp))
@throwTypeError("RegExp.prototype.@@matchAll requires |this| to be an Object");
- let string = @toString(strArg);
- let Matcher = @speciesConstructor(regExp, @RegExp);
+ var string = @toString(strArg);
+ var Matcher = @speciesConstructor(regExp, @RegExp);
- let flags = @toString(regExp.flags);
- let matcher = new Matcher(regExp, flags);
+ var flags = @toString(regExp.flags);
+ var matcher = new Matcher(regExp, flags);
matcher.lastIndex = @toLength(regExp.lastIndex);
- let global = @stringIncludesInternal.@call(flags, "g");
- let fullUnicode = @stringIncludesInternal.@call(flags, "u");
+ var global = @stringIncludesInternal.@call(flags, "g");
+ var fullUnicode = @stringIncludesInternal.@call(flags, "u");
return new @RegExpStringIterator(matcher, string, global, fullUnicode);
}
@@ -183,19 +183,19 @@
{
"use strict";
- let matchLength = matched.length;
- let stringLength = str.length;
- let tailPos = position + matchLength;
- let m = captures.length;
- let replacementLength = replacement.length;
- let result = "";
- let lastStart = 0;
+ var matchLength = matched.length;
+ var stringLength = str.length;
+ var tailPos = position + matchLength;
+ var m = captures.length;
+ var replacementLength = replacement.length;
+ var result = "";
+ var lastStart = 0;
- for (let start = 0; start = replacement.indexOf("$", lastStart), start !== -1; lastStart = start) {
+ for (var start = 0; start = replacement.indexOf("$", lastStart), start !== -1; lastStart = start) {
if (start - lastStart > 0)
result = result + replacement.substring(lastStart, start);
start++;
- let ch = replacement.charAt(start);
+ var ch = replacement.charAt(start);
if (ch === "")
result = result + "$";
else {
@@ -221,11 +221,11 @@
break;
case "<":
if (namedCaptures !== @undefined) {
- let groupNameStartIndex = start + 1;
- let groupNameEndIndex = replacement.indexOf(">", groupNameStartIndex);
+ var groupNameStartIndex = start + 1;
+ var groupNameEndIndex = replacement.indexOf(">", groupNameStartIndex);
if (groupNameEndIndex !== -1) {
- let groupName = replacement.substring(groupNameStartIndex, groupNameEndIndex);
- let capture = namedCaptures[groupName];
+ var groupName = replacement.substring(groupNameStartIndex, groupNameEndIndex);
+ var capture = namedCaptures[groupName];
if (capture !== @undefined)
result = result + @toString(capture);
@@ -238,12 +238,12 @@
start++;
break;
default:
- let chCode = ch.charCodeAt(0);
+ var chCode = ch.charCodeAt(0);
if (chCode >= 0x30 && chCode <= 0x39) {
- let originalStart = start - 1;
+ var originalStart = start - 1;
start++;
- let n = chCode - 0x30;
+ var n = chCode - 0x30;
if (n > m) {
result = result + replacement.substring(originalStart, start);
break;
@@ -250,9 +250,9 @@
}
if (start < replacementLength) {
- let nextChCode = replacement.charCodeAt(start);
+ var nextChCode = replacement.charCodeAt(start);
if (nextChCode >= 0x30 && nextChCode <= 0x39) {
- let nn = 10 * n + nextChCode - 0x30;
+ var nn = 10 * n + nextChCode - 0x30;
if (nn <= m) {
n = nn;
start++;
@@ -265,7 +265,7 @@
break;
}
- let capture = captures[n - 1];
+ var capture = captures[n - 1];
if (capture !== @undefined)
result = result + capture;
} else
@@ -281,17 +281,17 @@
if (!@isObject(this))
@throwTypeError("RegExp.prototype.@@replace requires that |this| be an Object");
- let regexp = this;
+ var regexp = this;
- let str = @toString(strArg);
- let stringLength = str.length;
- let functionalReplace = typeof replace === 'function';
+ var str = @toString(strArg);
+ var stringLength = str.length;
+ var functionalReplace = typeof replace === 'function';
if (!functionalReplace)
replace = @toString(replace);
- let global = regexp.global;
- let unicode = false;
+ var global = regexp.global;
+ var unicode = false;
if (global) {
unicode = regexp.unicode;
@@ -298,9 +298,9 @@
regexp.lastIndex = 0;
}
- let resultList = [];
- let result;
- let done = false;
+ var resultList = [];
+ var result;
+ var done = false;
while (!done) {
result = @regExpExec(regexp, str);
@@ -311,7 +311,7 @@
if (!global)
done = true;
else {
- let matchStr = @toString(result[0]);
+ var matchStr = @toString(result[0]);
if (!matchStr.length)
regexp.lastIndex = @advanceStringIndex(str, regexp.lastIndex, unicode);
@@ -319,34 +319,34 @@
}
}
- let accumulatedResult = "";
- let nextSourcePosition = 0;
- let lastPosition = 0;
+ var accumulatedResult = "";
+ var nextSourcePosition = 0;
+ var lastPosition = 0;
- for (let i = 0, resultListLength = resultList.length; i < resultListLength; ++i) {
- let result = resultList[i];
- let nCaptures = result.length - 1;
+ for (var i = 0, resultListLength = resultList.length; i < resultListLength; ++i) {
+ var result = resultList[i];
+ var nCaptures = result.length - 1;
if (nCaptures < 0)
nCaptures = 0;
- let matched = @toString(result[0]);
- let matchLength = matched.length;
- let position = result.index;
+ var matched = @toString(result[0]);
+ var matchLength = matched.length;
+ var position = result.index;
position = (position > stringLength) ? stringLength : position;
position = (position < 0) ? 0 : position;
- let captures = [];
- for (let n = 1; n <= nCaptures; n++) {
- let capN = result[n];
+ var captures = [];
+ for (var n = 1; n <= nCaptures; n++) {
+ var capN = result[n];
if (capN !== @undefined)
capN = @toString(capN);
captures.@push(capN);
}
- let replacement;
- let namedCaptures = result.groups;
+ var replacement;
+ var namedCaptures = result.groups;
if (functionalReplace) {
- let replacerArgs = [ matched ].concat(captures);
+ var replacerArgs = [ matched ].concat(captures);
replacerArgs.@push(position);
replacerArgs.@push(str);
@@ -353,7 +353,7 @@
if (namedCaptures !== @undefined)
replacerArgs.@push(namedCaptures);
- let replValue = replace.@apply(@undefined, replacerArgs);
+ var replValue = replace.@apply(@undefined, replacerArgs);
replacement = @toString(replValue);
} else {
if (namedCaptures !== @undefined)
@@ -381,7 +381,7 @@
{
"use strict";
- let regexp = this;
+ var regexp = this;
// Check for observable side effects and call the fast path if there aren't any.
if (@isRegExpObject(regexp)
@@ -395,10 +395,10 @@
@throwTypeError("RegExp.prototype.@@search requires that |this| be an Object");
// 3. Let S be ? ToString(string).
- let str = @toString(strArg)
+ var str = @toString(strArg)
// 4. Let previousLastIndex be ? Get(rx, "lastIndex").
- let previousLastIndex = regexp.lastIndex;
+ var previousLastIndex = regexp.lastIndex;
// 5.If SameValue(previousLastIndex, 0) is false, then
// 5.a. Perform ? Set(rx, "lastIndex", 0, true).
@@ -407,7 +407,7 @@
regexp.lastIndex = 0;
// 6. Let result be ? RegExpExec(rx, S).
- let result = @regExpExec(regexp, str);
+ var result = @regExpExec(regexp, str);
// 7. Let currentLastIndex be ? Get(rx, "lastIndex").
// 8. If SameValue(currentLastIndex, previousLastIndex) is false, then
@@ -433,34 +433,34 @@
return true;
// This is accessed by the RegExpExec internal function.
- let regexpExec = @tryGetById(regexp, "exec");
+ var regexpExec = @tryGetById(regexp, "exec");
if (regexpExec !== @regExpBuiltinExec)
return true;
// This is accessed by step 5 below.
- let regexpFlags = @tryGetById(regexp, "flags");
+ var regexpFlags = @tryGetById(regexp, "flags");
if (regexpFlags !== @regExpProtoFlagsGetter)
return true;
// These are accessed by the builtin flags getter.
- let regexpGlobal = @tryGetById(regexp, "global");
+ var regexpGlobal = @tryGetById(regexp, "global");
if (regexpGlobal !== @regExpProtoGlobalGetter)
return true;
- let regexpIgnoreCase = @tryGetById(regexp, "ignoreCase");
+ var regexpIgnoreCase = @tryGetById(regexp, "ignoreCase");
if (regexpIgnoreCase !== @regExpProtoIgnoreCaseGetter)
return true;
- let regexpMultiline = @tryGetById(regexp, "multiline");
+ var regexpMultiline = @tryGetById(regexp, "multiline");
if (regexpMultiline !== @regExpProtoMultilineGetter)
return true;
- let regexpSticky = @tryGetById(regexp, "sticky");
+ var regexpSticky = @tryGetById(regexp, "sticky");
if (regexpSticky !== @regExpProtoStickyGetter)
return true;
- let regexpUnicode = @tryGetById(regexp, "unicode");
+ var regexpUnicode = @tryGetById(regexp, "unicode");
if (regexpUnicode !== @regExpProtoUnicodeGetter)
return true;
// This is accessed by the RegExp species constructor.
- let regexpSource = @tryGetById(regexp, "source");
+ var regexpSource = @tryGetById(regexp, "source");
if (regexpSource !== @regExpProtoSourceGetter)
return true;
@@ -477,29 +477,29 @@
// 2. If Type(rx) is not Object, throw a TypeError exception.
if (!@isObject(this))
@throwTypeError("RegExp.prototype.@@split requires that |this| be an Object");
- let regexp = this;
+ var regexp = this;
// 3. Let S be ? ToString(string).
- let str = @toString(string);
+ var str = @toString(string);
// 4. Let C be ? SpeciesConstructor(rx, %RegExp%).
- let speciesConstructor = @speciesConstructor(regexp, @RegExp);
+ var speciesConstructor = @speciesConstructor(regexp, @RegExp);
if (speciesConstructor === @RegExp && !@hasObservableSideEffectsForRegExpSplit(regexp))
return @regExpSplitFast.@call(regexp, str, limit);
// 5. Let flags be ? ToString(? Get(rx, "flags")).
- let flags = @toString(regexp.flags);
+ var flags = @toString(regexp.flags);
- // 6. If flags contains "u", let unicodeMatching be true.
+ // 6. If flags contains "u", var unicodeMatching be true.
// 7. Else, let unicodeMatching be false.
- let unicodeMatching = @stringIncludesInternal.@call(flags, "u");
- // 8. If flags contains "y", let newFlags be flags.
+ var unicodeMatching = @stringIncludesInternal.@call(flags, "u");
+ // 8. If flags contains "y", var newFlags be flags.
// 9. Else, let newFlags be the string that is the concatenation of flags and "y".
- let newFlags = @stringIncludesInternal.@call(flags, "y") ? flags : flags + "y";
+ var newFlags = @stringIncludesInternal.@call(flags, "y") ? flags : flags + "y";
// 10. Let splitter be ? Construct(C, « rx, newFlags »).
- let splitter = new speciesConstructor(regexp, newFlags);
+ var splitter = new speciesConstructor(regexp, newFlags);
// We need to check again for RegExp subclasses that will fail the speciesConstructor test
// but can still use the fast path after we invoke the constructor above.
@@ -508,9 +508,9 @@
// 11. Let A be ArrayCreate(0).
// 12. Let lengthA be 0.
- let result = [];
+ var result = [];
- // 13. If limit is undefined, let lim be 2^32-1; else let lim be ? ToUint32(limit).
+ // 13. If limit is undefined, let lim be 2^32-1; else var lim be ? ToUint32(limit).
limit = (limit === @undefined) ? 0xffffffff : limit >>> 0;
// 16. If lim = 0, return A.
@@ -518,12 +518,12 @@
return result;
// 14. [Defered from above] Let size be the number of elements in S.
- let size = str.length;
+ var size = str.length;
// 17. If size = 0, then
if (!size) {
// a. Let z be ? RegExpExec(splitter, S).
- let z = @regExpExec(splitter, str);
+ var z = @regExpExec(splitter, str);
// b. If z is not null, return A.
if (z != null)
return result;
@@ -534,9 +534,9 @@
}
// 15. [Defered from above] Let p be 0.
- let position = 0;
+ var position = 0;
// 18. Let q be p.
- let matchPosition = 0;
+ var matchPosition = 0;
// 19. Repeat, while q < size
while (matchPosition < size) {
@@ -543,7 +543,7 @@
// a. Perform ? Set(splitter, "lastIndex", q, true).
splitter.lastIndex = matchPosition;
// b. Let z be ? RegExpExec(splitter, S).
- let matches = @regExpExec(splitter, str);
+ var matches = @regExpExec(splitter, str);
// c. If z is null, let q be AdvanceStringIndex(S, q, unicodeMatching).
if (matches === null)
matchPosition = @advanceStringIndex(str, matchPosition, unicodeMatching);
@@ -550,7 +550,7 @@
// d. Else z is not null,
else {
// i. Let e be ? ToLength(? Get(splitter, "lastIndex")).
- let endPosition = @toLength(splitter.lastIndex);
+ var endPosition = @toLength(splitter.lastIndex);
// ii. Let e be min(e, size).
endPosition = (endPosition <= size) ? endPosition : size;
// iii. If e = p, let q be AdvanceStringIndex(S, q, unicodeMatching).
@@ -559,7 +559,7 @@
// iv. Else e != p,
else {
// 1. Let T be a String value equal to the substring of S consisting of the elements at indices p (inclusive) through q (exclusive).
- let subStr = @stringSubstrInternal.@call(str, position, matchPosition - position);
+ var subStr = @stringSubstrInternal.@call(str, position, matchPosition - position);
// 2. Perform ! CreateDataProperty(A, ! ToString(lengthA), T).
// 3. Let lengthA be lengthA + 1.
@putByValDirect(result, result.length, subStr);
@@ -571,14 +571,14 @@
position = endPosition;
// 6. Let numberOfCaptures be ? ToLength(? Get(z, "length")).
// 7. Let numberOfCaptures be max(numberOfCaptures-1, 0).
- let numberOfCaptures = matches.length > 1 ? matches.length - 1 : 0;
+ var numberOfCaptures = matches.length > 1 ? matches.length - 1 : 0;
// 8. Let i be 1.
- let i = 1;
+ var i = 1;
// 9. Repeat, while i <= numberOfCaptures,
while (i <= numberOfCaptures) {
// a. Let nextCapture be ? Get(z, ! ToString(i)).
- let nextCapture = matches[i];
+ var nextCapture = matches[i];
// b. Perform ! CreateDataProperty(A, ! ToString(lengthA), nextCapture).
// d. Let lengthA be lengthA + 1.
@putByValDirect(result, result.length, nextCapture);
@@ -594,7 +594,7 @@
}
}
// 20. Let T be a String value equal to the substring of S consisting of the elements at indices p (inclusive) through size (exclusive).
- let remainingStr = @stringSubstrInternal.@call(str, position, size);
+ var remainingStr = @stringSubstrInternal.@call(str, position, size);
// 21. Perform ! CreateDataProperty(A, ! ToString(lengthA), T).
@putByValDirect(result, result.length, remainingStr);
// 22. Return A.
@@ -607,7 +607,7 @@
{
"use strict";
- let regexp = this;
+ var regexp = this;
// Check for observable side effects and call the fast path if there aren't any.
if (@isRegExpObject(regexp)
@@ -621,10 +621,10 @@
@throwTypeError("RegExp.prototype.test requires that |this| be an Object");
// 3. Let string be ? ToString(S).
- let str = @toString(strArg);
+ var str = @toString(strArg);
// 4. Let match be ? RegExpExec(R, string).
- let match = @regExpExec(regexp, str);
+ var match = @regExpExec(regexp, str);
// 5. If match is not null, return true; else return false.
if (match !== null)
Modified: trunk/Source/_javascript_Core/builtins/RegExpStringIteratorPrototype.js (254417 => 254418)
--- trunk/Source/_javascript_Core/builtins/RegExpStringIteratorPrototype.js 2020-01-13 00:21:42 UTC (rev 254417)
+++ trunk/Source/_javascript_Core/builtins/RegExpStringIteratorPrototype.js 2020-01-13 01:18:45 UTC (rev 254418)
@@ -30,7 +30,7 @@
if (!@isObject(this))
@throwTypeError("%RegExpStringIteratorPrototype%.next requires |this| to be an Object");
- let done = @getByIdDirectPrivate(this, "regExpStringIteratorDone");
+ var done = @getByIdDirectPrivate(this, "regExpStringIteratorDone");
if (done === @undefined)
@throwTypeError("%RegExpStringIteratorPrototype%.next requires |this| to be an RegExp String Iterator instance");
@@ -37,11 +37,11 @@
if (done)
return { value: @undefined, done: true };
- let regExp = @getByIdDirectPrivate(this, "regExpStringIteratorRegExp");
- let string = @getByIdDirectPrivate(this, "regExpStringIteratorString");
- let global = @getByIdDirectPrivate(this, "regExpStringIteratorGlobal");
- let fullUnicode = @getByIdDirectPrivate(this, "regExpStringIteratorUnicode");
- let match = @regExpExec(regExp, string);
+ var regExp = @getByIdDirectPrivate(this, "regExpStringIteratorRegExp");
+ var string = @getByIdDirectPrivate(this, "regExpStringIteratorString");
+ var global = @getByIdDirectPrivate(this, "regExpStringIteratorGlobal");
+ var fullUnicode = @getByIdDirectPrivate(this, "regExpStringIteratorUnicode");
+ var match = @regExpExec(regExp, string);
if (match === null) {
@putByIdDirectPrivate(this, "regExpStringIteratorDone", true);
return { value: @undefined, done: true };
@@ -48,9 +48,9 @@
}
if (global) {
- let matchStr = @toString(match[0]);
+ var matchStr = @toString(match[0]);
if (matchStr === "") {
- let thisIndex = @toLength(regExp.lastIndex);
+ var thisIndex = @toLength(regExp.lastIndex);
regExp.lastIndex = @advanceStringIndex(string, thisIndex, fullUnicode);
}
} else
Modified: trunk/Source/_javascript_Core/builtins/StringPrototype.js (254417 => 254418)
--- trunk/Source/_javascript_Core/builtins/StringPrototype.js 2020-01-13 00:21:42 UTC (rev 254417)
+++ trunk/Source/_javascript_Core/builtins/StringPrototype.js 2020-01-13 01:18:45 UTC (rev 254418)
@@ -38,8 +38,8 @@
return matcher.@call(regexp, this);
}
- let thisString = @toString(this);
- let createdRegExp = @regExpCreate(regexp, @undefined);
+ var thisString = @toString(this);
+ var createdRegExp = @regExpCreate(regexp, @undefined);
return createdRegExp.@matchSymbol(thisString);
}
@@ -54,13 +54,13 @@
if (@isRegExp(arg) && !@stringIncludesInternal.@call(@toString(arg.flags), "g"))
@throwTypeError("String.prototype.matchAll argument must not be a non-global regular _expression_");
- let matcher = arg.@matchAllSymbol;
+ var matcher = arg.@matchAllSymbol;
if (!@isUndefinedOrNull(matcher))
return matcher.@call(arg, this);
}
- let string = @toString(this);
- let regExp = @regExpCreate(arg, "g");
+ var string = @toString(this);
+ var regExp = @regExpCreate(arg, "g");
return regExp.@matchAllSymbol(string);
}
@@ -222,15 +222,15 @@
if (replacer !== @regExpPrototypeSymbolReplace)
return true;
- let regexpExec = @tryGetById(regexp, "exec");
+ var regexpExec = @tryGetById(regexp, "exec");
if (regexpExec !== @regExpBuiltinExec)
return true;
- let regexpGlobal = @tryGetById(regexp, "global");
+ var regexpGlobal = @tryGetById(regexp, "global");
if (regexpGlobal !== @regExpProtoGlobalGetter)
return true;
- let regexpUnicode = @tryGetById(regexp, "unicode");
+ var regexpUnicode = @tryGetById(regexp, "unicode");
if (regexpUnicode !== @regExpProtoUnicodeGetter)
return true;
@@ -246,7 +246,7 @@
@throwTypeError("String.prototype.replace requires that |this| not be null or undefined");
if (search != null) {
- let replacer = search.@replaceSymbol;
+ var replacer = search.@replaceSymbol;
if (replacer !== @undefined) {
if (!@hasObservableSideEffectsForStringReplace(search, replacer))
return @toString(this).@replaceUsingRegExp(search, replace);
@@ -254,8 +254,8 @@
}
}
- let thisString = @toString(this);
- let searchString = @toString(search);
+ var thisString = @toString(this);
+ var searchString = @toString(search);
return thisString.@replaceUsingStringSearch(searchString, replace);
}
@@ -346,16 +346,16 @@
"use strict";
if (@isUndefinedOrNull(string))
@throwTypeError(`${func} requires that |this| not be null or undefined`);
- let S = @toString(string);
- let p1 = "<" + tag;
+ var S = @toString(string);
+ var p1 = "<" + tag;
if (attribute) {
- let V = @toString(value);
- let escapedV = V.@replaceUsingRegExp(/"/g, '"');
+ var V = @toString(value);
+ var escapedV = V.@replaceUsingRegExp(/"/g, '"');
p1 = p1 + " " + @toString(attribute) + '="' + escapedV + '"'
}
- let p2 = p1 + ">"
- let p3 = p2 + S;
- let p4 = p3 + "</" + tag + ">";
+ var p2 = p1 + ">"
+ var p3 = p2 + S;
+ var p4 = p3 + "</" + tag + ">";
return p4;
}
Modified: trunk/Source/_javascript_Core/builtins/TypedArrayConstructor.js (254417 => 254418)
--- trunk/Source/_javascript_Core/builtins/TypedArrayConstructor.js 2020-01-13 00:21:42 UTC (rev 254417)
+++ trunk/Source/_javascript_Core/builtins/TypedArrayConstructor.js 2020-01-13 01:18:45 UTC (rev 254418)
@@ -31,14 +31,14 @@
function of(/* items... */)
{
"use strict";
- let len = arguments.length;
- let constructFunction = @getByIdDirectPrivate(this, "allocateTypedArray");
+ var len = arguments.length;
+ var constructFunction = @getByIdDirectPrivate(this, "allocateTypedArray");
if (constructFunction === @undefined)
@throwTypeError("TypedArray.of requires its this argument to subclass a TypedArray constructor");
- let result = constructFunction(len);
+ var result = constructFunction(len);
- for (let i = 0; i < len; i++)
+ for (var i = 0; i < len; i++)
result[i] = arguments[i];
return result;
@@ -48,9 +48,9 @@
{
"use strict";
- let mapFn = @argument(1);
+ var mapFn = @argument(1);
- let thisArg;
+ var thisArg;
if (mapFn !== @undefined) {
if (typeof mapFn !== "function")
@@ -59,25 +59,25 @@
thisArg = @argument(2);
}
- let arrayLike = @toObject(items, "TypedArray.from requires an array-like object - not null or undefined");
+ var arrayLike = @toObject(items, "TypedArray.from requires an array-like object - not null or undefined");
- let iteratorMethod = items.@iteratorSymbol;
+ var iteratorMethod = items.@iteratorSymbol;
if (iteratorMethod != null) {
if (typeof iteratorMethod !== "function")
@throwTypeError("TypedArray.from requires that the property of the first argument, items[Symbol.iterator], when exists, be a function");
- let accumulator = [];
+ var accumulator = [];
- let k = 0;
- let iterator = iteratorMethod.@call(items);
+ var k = 0;
+ var iterator = iteratorMethod.@call(items);
// Since for-of loop once more looks up the @@iterator property of a given iterable,
// it could be observable if the user defines a getter for @@iterator.
// To avoid this situation, we define a wrapper object that @@iterator just returns a given iterator.
- let wrapper = {};
+ var wrapper = {};
wrapper.@iteratorSymbol = function() { return iterator; }
- for (let value of wrapper) {
+ for (var value of wrapper) {
if (mapFn)
@putByValDirect(accumulator, k, thisArg === @undefined ? mapFn(value, k) : mapFn.@call(thisArg, value, k));
else
@@ -85,13 +85,13 @@
k++;
}
- let constructFunction = @getByIdDirectPrivate(this, "allocateTypedArray");
+ var constructFunction = @getByIdDirectPrivate(this, "allocateTypedArray");
if (constructFunction === @undefined)
@throwTypeError("TypedArray.from requires its this argument subclass a TypedArray constructor");
- let result = constructFunction(k);
+ var result = constructFunction(k);
- for (let i = 0; i < k; i++)
+ for (var i = 0; i < k; i++)
result[i] = accumulator[i];
@@ -98,17 +98,17 @@
return result;
}
- let arrayLikeLength = @toLength(arrayLike.length);
+ var arrayLikeLength = @toLength(arrayLike.length);
- let constructFunction = @getByIdDirectPrivate(this, "allocateTypedArray");
+ var constructFunction = @getByIdDirectPrivate(this, "allocateTypedArray");
if (constructFunction === @undefined)
@throwTypeError("this does not subclass a TypedArray constructor");
- let result = constructFunction(arrayLikeLength);
+ var result = constructFunction(arrayLikeLength);
- let k = 0;
+ var k = 0;
while (k < arrayLikeLength) {
- let value = arrayLike[k];
+ var value = arrayLike[k];
if (mapFn)
result[k] = thisArg === @undefined ? mapFn(value, k) : mapFn.@call(thisArg, value, k);
else
Modified: trunk/Source/_javascript_Core/builtins/TypedArrayPrototype.js (254417 => 254418)
--- trunk/Source/_javascript_Core/builtins/TypedArrayPrototype.js 2020-01-13 00:21:42 UTC (rev 254417)
+++ trunk/Source/_javascript_Core/builtins/TypedArrayPrototype.js 2020-01-13 01:18:45 UTC (rev 254418)
@@ -35,7 +35,7 @@
function typedArraySpeciesConstructor(value)
{
"use strict";
- let constructor = value.constructor;
+ var constructor = value.constructor;
if (constructor === @undefined)
return @typedArrayGetOriginalConstructor(value);
@@ -60,7 +60,7 @@
if (value === @undefined)
return undefinedValue;
- let int = @toInteger(value);
+ var int = @toInteger(value);
if (int < 0) {
int += length;
return int < 0 ? 0 : int;
@@ -89,15 +89,15 @@
{
"use strict";
- let length = @typedArrayLength(this);
+ var length = @typedArrayLength(this);
- let start = @argument(1);
- let end = @argument(2);
+ var start = @argument(1);
+ var end = @argument(2);
start = @typedArrayClampArgumentToStartOrEnd(start, length, 0);
end = @typedArrayClampArgumentToStartOrEnd(end, length, length);
- for (let i = start; i < end; i++)
+ for (var i = start; i < end; i++)
this[i] = value;
return this;
}
@@ -112,7 +112,7 @@
@throwTypeError("TypedArray.prototype.find callback must be a function");
for (var i = 0; i < length; i++) {
- let elem = this[i];
+ var elem = this[i];
if (callback.@call(thisArg, elem, i, this))
return elem;
}
@@ -238,12 +238,12 @@
if (!@isTypedArrayView(this))
@throwTypeError("|this| should be a typed array view");
- let start = @toInteger(begin);
- let finish;
+ var start = @toInteger(begin);
+ var finish;
if (end !== @undefined)
finish = @toInteger(end);
- let constructor = @typedArraySpeciesConstructor(this);
+ var constructor = @typedArraySpeciesConstructor(this);
return @typedArraySubarrayCreate.@call(this, start, finish, constructor);
}