Skip to content

Commit

Permalink
Remove let/const, use var
Browse files Browse the repository at this point in the history
  • Loading branch information
peterwmwong committed Mar 19, 2018
1 parent b4b85c6 commit 29906bb
Show file tree
Hide file tree
Showing 46 changed files with 110 additions and 110 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ info: |
features: [Symbol.match, Symbol.matchAll]
---*/

const obj = {
var obj = {
get [Symbol.match]() {
throw new Test262Error();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ info: |
features: [Symbol.matchAll]
---*/

const obj = {
var obj = {
toString() {
throw new Test262Error();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ info: |
features: [Symbol.matchAll]
---*/

const regexp = /./;
var regexp = /./;
Object.defineProperty(regexp, 'constructor', {
get(){
throw new Test262Error();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ info: |
features: [Symbol.matchAll, Symbol.species]
---*/

const regexp = /./;
var regexp = /./;
regexp.constructor = {
get [Symbol.species]() {
throw new Test262Error();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ info: |
features: [Symbol.matchAll]
---*/

const regexp = /./;
var regexp = /./;

function callMatchAll() { regexp[Symbol.matchAll](''); }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ features: [Symbol.matchAll]
includes: [compareArray.js]
---*/

const regexp = /\w/g;
var regexp = /\w/g;
regexp.constructor = undefined;
const str = 'a*b';
const iter = regexp[Symbol.matchAll](str);
var str = 'a*b';
var iter = regexp[Symbol.matchAll](str);

let { value, done } = iter.next();
var { value, done } = iter.next();
assert.compareArray(value, ['a']);
assert.sameValue(value.index, 0);
assert.sameValue(value.input, str);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ info: |
features: [Symbol.matchAll, Symbol.species]
---*/

const regexp = /./;
const speciesConstructor = {};
var regexp = /./;
var speciesConstructor = {};
regexp.constructor = speciesConstructor;

const callMatchAll = function() {
var callMatchAll = function() {
regexp[Symbol.matchAll]('');
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ includes: [compareArray.js]
---*/

function TestWithConstructor(ctor) {
const regexp = /\w/g;
var regexp = /\w/g;
regexp.constructor = {
[Symbol.species]: ctor
};
const str = 'a*b';
const iter = regexp[Symbol.matchAll](str);
var str = 'a*b';
var iter = regexp[Symbol.matchAll](str);

let { value, done } = iter.next();
var { value, done } = iter.next();
assert.compareArray(value, ['a']);
assert.sameValue(value.index, 0);
assert.sameValue(value.input, str);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ info: |
features: [Symbol.matchAll, Symbol.species]
---*/

const regexp = /./;
var regexp = /./;
regexp.constructor = {
[Symbol.species]: function() {
throw new Test262Error();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,25 @@ features: [Symbol.matchAll, Symbol.species]
includes: [compareArray.js]
---*/

let callCount = 0;
let callArgs;
const regexp = /\d/u;
var callCount = 0;
var callArgs;
var regexp = /\d/u;
regexp.constructor = {
[Symbol.species]: function(){
callCount++;callArgs
callArgs = arguments;
return /\w/g;
}
};
const str = 'a*b';
const iter = regexp[Symbol.matchAll](str);
var str = 'a*b';
var iter = regexp[Symbol.matchAll](str);

assert.sameValue(callCount, 1);callArgs
assert.sameValue(callArgs.length, 2);
assert.sameValue(callArgs[0], regexp);
assert.sameValue(callArgs[1], 'u');

let { value, done } = iter.next();
var { value, done } = iter.next();
assert.compareArray(value, ['a']);
assert.sameValue(value.index, 0);
assert.sameValue(value.input, str);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ info: |
features: [Symbol.matchAll, Symbol.species]
---*/

const regexp = /./;
var regexp = /./;
regexp.constructor = {
[Symbol.species]: function() {
return Object.defineProperty(/./, 'global', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ info: |
features: [Symbol.matchAll, Symbol.species]
---*/

const regexp = /./;
var regexp = /./;
regexp.constructor = {
[Symbol.species]: function() {
return Object.defineProperty(/./, 'unicode', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ info: |
features: [Symbol.matchAll]
---*/

const obj = {
var obj = {
valueOf() {
$ERROR('This method should not be invoked.');
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ features: [Symbol.matchAll]
includes: [compareArray.js]
---*/

const str = 'a*b';
const obj = {
var str = 'a*b';
var obj = {
toString() {
return str;
}
};
const regexp = /\w/g;
const iter = regexp[Symbol.matchAll](obj);
var regexp = /\w/g;
var iter = regexp[Symbol.matchAll](obj);

let { value, done } = iter.next();
var { value, done } = iter.next();
assert.compareArray(value, ['a']);
assert.sameValue(value.index, 0);
assert.sameValue(value.input, str);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ info: |
features: [Symbol.matchAll]
---*/

const regexp = /./;
var regexp = /./;
Object.defineProperty(regexp, 'flags', {
get() {
throw new Test262Error();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ features: [Symbol.matchAll]
includes: [compareArray.js]
---*/

const regexp = /\w/;
var regexp = /\w/;
Object.defineProperty(regexp, 'flags', {
value: 'g'
});
const str = 'a*b';
const iter = regexp[Symbol.matchAll](str);
var str = 'a*b';
var iter = regexp[Symbol.matchAll](str);

let { value, done } = iter.next();
var { value, done } = iter.next();
assert.compareArray(value, ['a']);
assert.sameValue(value.index, 0);
assert.sameValue(value.input, str);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ features: [Symbol.matchAll]
includes: [compareArray.js]
---*/

const regexp = /./g;
var regexp = /./g;
regexp.lastIndex = {
valueOf() {
return 2;
}
};
const str = 'abcd';
const iter = regexp[Symbol.matchAll](str);
var str = 'abcd';
var iter = regexp[Symbol.matchAll](str);

// Verify lastIndex is cached at the time of calling @@matchAll
regexp.lastIndex = 0;

let { value, done } = iter.next();
var { value, done } = iter.next();
assert.compareArray(value, ['c']);
assert.sameValue(value.index, 2);
assert.sameValue(value.input, str);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ info: |
features: [Symbol.matchAll]
---*/

let thisValue;
const callMatchAll = function() {
var thisValue;
var callMatchAll = function() {
RegExp.prototype[Symbol.matchAll].call(thisValue, '');
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ info: |
features: [Symbol.matchAll]
---*/

const regexp = /./;
var regexp = /./;
regexp.lastIndex = {
valueOf() {
throw new Test262Error();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ info: |
features: [Symbol.matchAll]
---*/

const regexp = /\w/;
var regexp = /\w/;
Object.defineProperty(regexp, 'flags', {
value: {
valueOf() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ features: [Symbol.matchAll]
includes: [compareArray.js]
---*/

const regexp = /\w/;
var regexp = /\w/;
Object.defineProperty(regexp, 'flags', {
value: {
toString() {
return 'g';
}
}
});
const str = 'a*b';
const iter = regexp[Symbol.matchAll](str);
var str = 'a*b';
var iter = regexp[Symbol.matchAll](str);

let { value, done } = iter.next();
var { value, done } = iter.next();
assert.compareArray(value, ['a']);
assert.sameValue(value.index, 0);
assert.sameValue(value.input, str);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ features: [Symbol.matchAll, Symbol.toStringTag]
includes: [propertyHelper.js]
---*/

const RegExpStringIteratorProto = Object.getPrototypeOf(/./[Symbol.matchAll](''));
var RegExpStringIteratorProto = Object.getPrototypeOf(/./[Symbol.matchAll](''));

assert.sameValue(RegExpStringIteratorProto[Symbol.toStringTag], 'RegExp String Iterator');

Expand Down
4 changes: 2 additions & 2 deletions test/built-ins/RegExpStringIteratorPrototype/ancestry.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ description: |
features: [Symbol.iterator, Symbol.matchAll]
---*/

const RegExpStringIteratorProto = Object.getPrototypeOf(/./[Symbol.matchAll]('a'));
const ArrayIteratorProto = Object.getPrototypeOf(
var RegExpStringIteratorProto = Object.getPrototypeOf(/./[Symbol.matchAll]('a'));
var ArrayIteratorProto = Object.getPrototypeOf(
Object.getPrototypeOf([][Symbol.iterator]())
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ info: |
features: [Symbol.matchAll]
---*/

const iter = /./[Symbol.matchAll]('');
var iter = /./[Symbol.matchAll]('');

RegExp.prototype.exec = function() {
throw new Test262Error();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ info: |
features: [Symbol.matchAll]
---*/

const iter = /./[Symbol.matchAll]('');
var iter = /./[Symbol.matchAll]('');

Object.defineProperty(RegExp.prototype, 'exec', {
get() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ info: |
features: [Symbol.matchAll]
---*/

const iter = /./g[Symbol.matchAll]('');
var iter = /./g[Symbol.matchAll]('');

RegExp.prototype.exec = function() {
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ info: |
features: [Symbol.matchAll]
---*/

const iter = /./g[Symbol.matchAll]('');
var iter = /./g[Symbol.matchAll]('');

RegExp.prototype.exec = function() {
return [{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,23 @@ info: |
features: [Symbol.matchAll]
---*/

const iter = /./g[Symbol.matchAll]('');
var iter = /./g[Symbol.matchAll]('');

const execResult = {
var execResult = {
get '0'() {
return {
toString() { return ''; }
};
}
};

let internalRegExp;
var internalRegExp;
RegExp.prototype.exec = function () {
internalRegExp = this;
return execResult;
};

let { value, done } = iter.next();
var { value, done } = iter.next();
assert.sameValue(internalRegExp.lastIndex, 1);
assert.sameValue(value, execResult);
assert(!done);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ features: [Symbol.matchAll]
function TestWithRegExpExec(exec) {
RegExp.prototype.exec = exec;

const regexp = /\w/g;
const str = 'a*b';
const iter = regexp[Symbol.matchAll](str);
var regexp = /\w/g;
var str = 'a*b';
var iter = regexp[Symbol.matchAll](str);

let { value, done } = iter.next();
var { value, done } = iter.next();
assert.compareArray(value, ['a']);
assert.sameValue(value.index, 0);
assert.sameValue(value.input, str);
Expand Down
Loading

0 comments on commit 29906bb

Please sign in to comment.