Skip to content

Commit 20b456b

Browse files
fix: Add missing Math.tanh support and test
1 parent 54518be commit 20b456b

File tree

6 files changed

+62
-56
lines changed

6 files changed

+62
-56
lines changed

dist/gpu-browser-core.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
*
55
* GPU Accelerated JavaScript
66
*
7-
* @version 2.6.10
8-
* @date Mon Mar 09 2020 05:45:42 GMT-0400 (Eastern Daylight Time)
7+
* @version 2.6.11
8+
* @date Mon Mar 09 2020 05:48:54 GMT-0400 (Eastern Daylight Time)
99
*
1010
* @license MIT
1111
* The MIT License

dist/gpu-browser-core.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/gpu-browser.js

Lines changed: 39 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
*
55
* GPU Accelerated JavaScript
66
*
7-
* @version 2.6.10
8-
* @date Mon Mar 09 2020 05:45:42 GMT-0400 (Eastern Daylight Time)
7+
* @version 2.6.11
8+
* @date Mon Mar 09 2020 05:48:54 GMT-0400 (Eastern Daylight Time)
99
*
1010
* @license MIT
1111
* The MIT License
@@ -1618,8 +1618,10 @@
16181618
if (this.options.ecmaVersion >= 6) {
16191619
if (name === "__proto__" && kind === "init") {
16201620
if (propHash.proto) {
1621-
if (refDestructuringErrors && refDestructuringErrors.doubleProto < 0) { refDestructuringErrors.doubleProto = key.start; }
1622-
else { this.raiseRecoverable(key.start, "Redefinition of __proto__ property"); }
1621+
if (refDestructuringErrors) {
1622+
if (refDestructuringErrors.doubleProto < 0)
1623+
{ refDestructuringErrors.doubleProto = key.start; }
1624+
} else { this.raiseRecoverable(key.start, "Redefinition of __proto__ property"); }
16231625
}
16241626
propHash.proto = true;
16251627
}
@@ -1668,12 +1670,11 @@
16681670
else { this.exprAllowed = false; }
16691671
}
16701672

1671-
var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1, oldShorthandAssign = -1;
1673+
var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1;
16721674
if (refDestructuringErrors) {
16731675
oldParenAssign = refDestructuringErrors.parenthesizedAssign;
16741676
oldTrailingComma = refDestructuringErrors.trailingComma;
1675-
oldShorthandAssign = refDestructuringErrors.shorthandAssign;
1676-
refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.shorthandAssign = -1;
1677+
refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = -1;
16771678
} else {
16781679
refDestructuringErrors = new DestructuringErrors;
16791680
ownDestructuringErrors = true;
@@ -1688,8 +1689,11 @@
16881689
var node = this.startNodeAt(startPos, startLoc);
16891690
node.operator = this.value;
16901691
node.left = this.type === types.eq ? this.toAssignable(left, false, refDestructuringErrors) : left;
1691-
if (!ownDestructuringErrors) { DestructuringErrors.call(refDestructuringErrors); }
1692-
refDestructuringErrors.shorthandAssign = -1;
1692+
if (!ownDestructuringErrors) {
1693+
refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.doubleProto = -1;
1694+
}
1695+
if (refDestructuringErrors.shorthandAssign >= node.left.start)
1696+
{ refDestructuringErrors.shorthandAssign = -1; }
16931697
this.checkLVal(left);
16941698
this.next();
16951699
node.right = this.parseMaybeAssign(noIn);
@@ -1699,7 +1703,6 @@
16991703
}
17001704
if (oldParenAssign > -1) { refDestructuringErrors.parenthesizedAssign = oldParenAssign; }
17011705
if (oldTrailingComma > -1) { refDestructuringErrors.trailingComma = oldTrailingComma; }
1702-
if (oldShorthandAssign > -1) { refDestructuringErrors.shorthandAssign = oldShorthandAssign; }
17031706
return left
17041707
};
17051708

@@ -1795,8 +1798,8 @@
17951798
pp$3.parseExprSubscripts = function(refDestructuringErrors) {
17961799
var startPos = this.start, startLoc = this.startLoc;
17971800
var expr = this.parseExprAtom(refDestructuringErrors);
1798-
var skipArrowSubscripts = expr.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")";
1799-
if (this.checkExpressionErrors(refDestructuringErrors) || skipArrowSubscripts) { return expr }
1801+
if (expr.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")")
1802+
{ return expr }
18001803
var result = this.parseSubscripts(expr, startPos, startLoc);
18011804
if (refDestructuringErrors && result.type === "MemberExpression") {
18021805
if (refDestructuringErrors.parenthesizedAssign >= result.start) { refDestructuringErrors.parenthesizedAssign = -1; }
@@ -2074,6 +2077,7 @@
20742077
var empty$1 = [];
20752078

20762079
pp$3.parseNew = function() {
2080+
if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword new"); }
20772081
var node = this.startNode();
20782082
var meta = this.parseIdent(true);
20792083
if (this.options.ecmaVersion >= 6 && this.eat(types.dot)) {
@@ -2442,7 +2446,7 @@
24422446
} else {
24432447
this.unexpected();
24442448
}
2445-
this.next();
2449+
this.next(!!liberal);
24462450
this.finishNode(node, "Identifier");
24472451
if (!liberal) {
24482452
this.checkUnreserved(node);
@@ -2473,7 +2477,7 @@
24732477

24742478
var node = this.startNode();
24752479
this.next();
2476-
node.argument = this.parseMaybeUnary(null, true);
2480+
node.argument = this.parseMaybeUnary(null, false);
24772481
return this.finishNode(node, "AwaitExpression")
24782482
};
24792483

@@ -2841,7 +2845,8 @@
28412845
if (!this.switchU || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l) {
28422846
return c
28432847
}
2844-
return (c << 10) + s.charCodeAt(i + 1) - 0x35FDC00
2848+
var next = s.charCodeAt(i + 1);
2849+
return next >= 0xDC00 && next <= 0xDFFF ? (c << 10) + next - 0x35FDC00 : c
28452850
};
28462851

28472852
RegExpValidationState.prototype.nextIndex = function nextIndex (i) {
@@ -2850,8 +2855,9 @@
28502855
if (i >= l) {
28512856
return l
28522857
}
2853-
var c = s.charCodeAt(i);
2854-
if (!this.switchU || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l) {
2858+
var c = s.charCodeAt(i), next;
2859+
if (!this.switchU || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l ||
2860+
(next = s.charCodeAt(i + 1)) < 0xDC00 || next > 0xDFFF) {
28552861
return i + 1
28562862
}
28572863
return i + 2
@@ -3750,7 +3756,9 @@
37503756
var pp$9 = Parser.prototype;
37513757

37523758

3753-
pp$9.next = function() {
3759+
pp$9.next = function(ignoreEscapeSequenceInKeyword) {
3760+
if (!ignoreEscapeSequenceInKeyword && this.type.keyword && this.containsEsc)
3761+
{ this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword); }
37543762
if (this.options.onToken)
37553763
{ this.options.onToken(new Token(this)); }
37563764

@@ -4127,7 +4135,6 @@
41274135
if (!startsWithDot && this.readInt(10) === null) { this.raise(start, "Invalid number"); }
41284136
var octal = this.pos - start >= 2 && this.input.charCodeAt(start) === 48;
41294137
if (octal && this.strict) { this.raise(start, "Invalid number"); }
4130-
if (octal && /[89]/.test(this.input.slice(start, this.pos))) { octal = false; }
41314138
var next = this.input.charCodeAt(this.pos);
41324139
if (!octal && !startsWithDot && this.options.ecmaVersion >= 11 && next === 110) {
41334140
var str$1 = this.input.slice(start, this.pos);
@@ -4136,6 +4143,7 @@
41364143
if (isIdentifierStart(this.fullCharCodeAtPos())) { this.raise(this.pos, "Identifier directly after number"); }
41374144
return this.finishToken(types.num, val$1)
41384145
}
4146+
if (octal && /[89]/.test(this.input.slice(start, this.pos))) { octal = false; }
41394147
if (next === 46 && !octal) {
41404148
++this.pos;
41414149
this.readInt(10);
@@ -4303,6 +4311,18 @@
43034311
case 10:
43044312
if (this.options.locations) { this.lineStart = this.pos; ++this.curLine; }
43054313
return ""
4314+
case 56:
4315+
case 57:
4316+
if (inTemplate) {
4317+
var codePos = this.pos - 1;
4318+
4319+
this.invalidStringToken(
4320+
codePos,
4321+
"Invalid escape sequence in template string"
4322+
);
4323+
4324+
return null
4325+
}
43064326
default:
43074327
if (ch >= 48 && ch <= 55) {
43084328
var octalStr = this.input.substr(this.pos - 1, 3).match(/^[0-7]+/)[0];
@@ -4372,7 +4392,6 @@
43724392
var word = this.readWord1();
43734393
var type = types.name;
43744394
if (this.keywords.test(word)) {
4375-
if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword " + word); }
43764395
type = keywords$1[word];
43774396
}
43784397
return this.finishToken(type, word)

dist/gpu-browser.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 14 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gpu.js",
3-
"version": "2.6.10",
3+
"version": "2.6.11",
44
"description": "GPU Accelerated JavaScript",
55
"engines": {
66
"node": ">=8.0.0"
@@ -18,7 +18,7 @@
1818
"test": "test"
1919
},
2020
"dependencies": {
21-
"acorn": "^7.1.0",
21+
"acorn": "^7.1.1",
2222
"gl": "^4.4.1",
2323
"gl-wiretap": "^0.6.2",
2424
"gpu-mock.js": "^1.1.1"

0 commit comments

Comments
 (0)