Skip to content

Commit

Permalink
[meta] better eccheck command; fix indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Jan 11, 2022
1 parent d98b721 commit b365e42
Show file tree
Hide file tree
Showing 52 changed files with 280 additions and 426 deletions.
2 changes: 2 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ trim_trailing_whitespace = true;
spaces_in_brackets = false;
end_of_line = lf;

[CHANGELOG.md]
indent_style = space
14 changes: 7 additions & 7 deletions 2015/ArrayCreate.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ module.exports = function ArrayCreate(length) {
A.length = length;
}
/* step 10, the above as a shortcut for the below
OrdinaryDefineOwnProperty(A, 'length', {
'[[Configurable]]': false,
'[[Enumerable]]': false,
'[[Value]]': length,
'[[Writable]]': true
});
*/
OrdinaryDefineOwnProperty(A, 'length', {
'[[Configurable]]': false,
'[[Enumerable]]': false,
'[[Value]]': length,
'[[Writable]]': true
});
*/
return A;
};
7 changes: 1 addition & 6 deletions 2015/Get.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,7 @@ var inspect = require('object-inspect');
var IsPropertyKey = require('./IsPropertyKey');
var Type = require('./Type');

/**
* 7.3.1 Get (O, P) - https://ecma-international.org/ecma-262/6.0/#sec-get-o-p
* 1. Assert: Type(O) is Object.
* 2. Assert: IsPropertyKey(P) is true.
* 3. Return O.[[Get]](P, O).
*/
// https://ecma-international.org/ecma-262/6.0/#sec-get-o-p

module.exports = function Get(O, P) {
// 7.3.1.1
Expand Down
10 changes: 1 addition & 9 deletions 2015/GetMethod.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,7 @@ var GetV = require('./GetV');
var IsCallable = require('./IsCallable');
var IsPropertyKey = require('./IsPropertyKey');

/**
* 7.3.9 - https://ecma-international.org/ecma-262/6.0/#sec-getmethod
* 1. Assert: IsPropertyKey(P) is true.
* 2. Let func be GetV(O, P).
* 3. ReturnIfAbrupt(func).
* 4. If func is either undefined or null, return undefined.
* 5. If IsCallable(func) is false, throw a TypeError exception.
* 6. Return func.
*/
// https://ecma-international.org/ecma-262/6.0/#sec-getmethod

module.exports = function GetMethod(O, P) {
// 7.3.9.1
Expand Down
8 changes: 1 addition & 7 deletions 2015/GetV.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,7 @@ var $TypeError = GetIntrinsic('%TypeError%');
var IsPropertyKey = require('./IsPropertyKey');
var ToObject = require('./ToObject');

/**
* 7.3.2 GetV (V, P)
* 1. Assert: IsPropertyKey(P) is true.
* 2. Let O be ToObject(V).
* 3. ReturnIfAbrupt(O).
* 4. Return O.[[Get]](P, V).
*/
// https:// ecma-international.org/ecma-262/6.0/#sec-getv

module.exports = function GetV(V, P) {
// 7.3.2.1
Expand Down
14 changes: 7 additions & 7 deletions 2016/ArrayCreate.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 1 addition & 6 deletions 2016/Get.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 1 addition & 9 deletions 2016/GetMethod.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 1 addition & 7 deletions 2016/GetV.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 0 additions & 15 deletions 2016/IterableToArrayLike.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,6 @@ var ES = {
};

// https://262.ecma-international.org/7.0/#sec-iterabletoarraylike
/**
* 1. Let usingIterator be ? GetMethod(items, @@iterator).
* 2. If usingIterator is not undefined, then
* 1. Let iterator be ? GetIterator(items, usingIterator).
* 2. Let values be a new empty List.
* 3. Let next be true.
* 4. Repeat, while next is not false
* 1. Let next be ? IteratorStep(iterator).
* 2. If next is not false, then
* 1. Let nextValue be ? IteratorValue(next).
* 2. Append nextValue to the end of the List values.
* 5. Return CreateArrayFromList(values).
* 3. NOTE: items is not an Iterable so assume it is already an array-like object.
* 4. Return ! ToObject(items).
*/

module.exports = function IterableToArrayLike(items) {
var usingIterator = getIteratorMethod(ES, items);
Expand Down
54 changes: 27 additions & 27 deletions 2016/OrdinarySetPrototypeOf.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,38 +16,38 @@ module.exports = function OrdinarySetPrototypeOf(O, V) {
throw new $TypeError('Assertion failed: V must be Object or Null');
}
/*
var extensible = IsExtensible(O);
var current = OrdinaryGetPrototypeOf(O);
if (SameValue(V, current)) {
return true;
}
if (!extensible) {
return false;
}
*/
var extensible = IsExtensible(O);
var current = OrdinaryGetPrototypeOf(O);
if (SameValue(V, current)) {
return true;
}
if (!extensible) {
return false;
}
*/
try {
$setProto(O, V);
} catch (e) {
return false;
}
return OrdinaryGetPrototypeOf(O) === V;
/*
var p = V;
var done = false;
while (!done) {
if (p === null) {
done = true;
} else if (SameValue(p, O)) {
return false;
} else {
if (wat) {
done = true;
} else {
p = p.[[Prototype]];
}
}
}
O.[[Prototype]] = V;
return true;
*/
var p = V;
var done = false;
while (!done) {
if (p === null) {
done = true;
} else if (SameValue(p, O)) {
return false;
} else {
if (wat) {
done = true;
} else {
p = p.[[Prototype]];
}
}
}
O.[[Prototype]] = V;
return true;
*/
};
14 changes: 7 additions & 7 deletions 2017/ArrayCreate.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 1 addition & 6 deletions 2017/Get.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 1 addition & 9 deletions 2017/GetMethod.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 1 addition & 7 deletions 2017/GetV.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

54 changes: 27 additions & 27 deletions 2017/OrdinarySetPrototypeOf.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions 2018/ArrayCreate.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions 2018/CopyDataProperties.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ module.exports = function CopyDataProperties(target, source, excludedItems) {
var enumerable = $isEnumerable(fromObj, nextKey) || (
// this is to handle string keys being non-enumerable in older engines
typeof source === 'string'
&& nextKey >= 0
&& IsInteger(ToNumber(nextKey))
&& nextKey >= 0
&& IsInteger(ToNumber(nextKey))
);
if (excluded === false && enumerable) {
var propValue = Get(fromObj, nextKey);
Expand Down
Loading

0 comments on commit b365e42

Please sign in to comment.