Skip to content

Commit

Permalink
fix: Add missing Math.tanh support and test
Browse files Browse the repository at this point in the history
  • Loading branch information
robertleeplummerjr committed Mar 9, 2020
1 parent 54518be commit 20b456b
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 56 deletions.
4 changes: 2 additions & 2 deletions dist/gpu-browser-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
*
* GPU Accelerated JavaScript
*
* @version 2.6.10
* @date Mon Mar 09 2020 05:45:42 GMT-0400 (Eastern Daylight Time)
* @version 2.6.11
* @date Mon Mar 09 2020 05:48:54 GMT-0400 (Eastern Daylight Time)
*
* @license MIT
* The MIT License
Expand Down
4 changes: 2 additions & 2 deletions dist/gpu-browser-core.min.js

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

59 changes: 39 additions & 20 deletions dist/gpu-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
*
* GPU Accelerated JavaScript
*
* @version 2.6.10
* @date Mon Mar 09 2020 05:45:42 GMT-0400 (Eastern Daylight Time)
* @version 2.6.11
* @date Mon Mar 09 2020 05:48:54 GMT-0400 (Eastern Daylight Time)
*
* @license MIT
* The MIT License
Expand Down Expand Up @@ -1618,8 +1618,10 @@
if (this.options.ecmaVersion >= 6) {
if (name === "__proto__" && kind === "init") {
if (propHash.proto) {
if (refDestructuringErrors && refDestructuringErrors.doubleProto < 0) { refDestructuringErrors.doubleProto = key.start; }
else { this.raiseRecoverable(key.start, "Redefinition of __proto__ property"); }
if (refDestructuringErrors) {
if (refDestructuringErrors.doubleProto < 0)
{ refDestructuringErrors.doubleProto = key.start; }
} else { this.raiseRecoverable(key.start, "Redefinition of __proto__ property"); }
}
propHash.proto = true;
}
Expand Down Expand Up @@ -1668,12 +1670,11 @@
else { this.exprAllowed = false; }
}

var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1, oldShorthandAssign = -1;
var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1;
if (refDestructuringErrors) {
oldParenAssign = refDestructuringErrors.parenthesizedAssign;
oldTrailingComma = refDestructuringErrors.trailingComma;
oldShorthandAssign = refDestructuringErrors.shorthandAssign;
refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.shorthandAssign = -1;
refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = -1;
} else {
refDestructuringErrors = new DestructuringErrors;
ownDestructuringErrors = true;
Expand All @@ -1688,8 +1689,11 @@
var node = this.startNodeAt(startPos, startLoc);
node.operator = this.value;
node.left = this.type === types.eq ? this.toAssignable(left, false, refDestructuringErrors) : left;
if (!ownDestructuringErrors) { DestructuringErrors.call(refDestructuringErrors); }
refDestructuringErrors.shorthandAssign = -1;
if (!ownDestructuringErrors) {
refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.doubleProto = -1;
}
if (refDestructuringErrors.shorthandAssign >= node.left.start)
{ refDestructuringErrors.shorthandAssign = -1; }
this.checkLVal(left);
this.next();
node.right = this.parseMaybeAssign(noIn);
Expand All @@ -1699,7 +1703,6 @@
}
if (oldParenAssign > -1) { refDestructuringErrors.parenthesizedAssign = oldParenAssign; }
if (oldTrailingComma > -1) { refDestructuringErrors.trailingComma = oldTrailingComma; }
if (oldShorthandAssign > -1) { refDestructuringErrors.shorthandAssign = oldShorthandAssign; }
return left
};

Expand Down Expand Up @@ -1795,8 +1798,8 @@
pp$3.parseExprSubscripts = function(refDestructuringErrors) {
var startPos = this.start, startLoc = this.startLoc;
var expr = this.parseExprAtom(refDestructuringErrors);
var skipArrowSubscripts = expr.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")";
if (this.checkExpressionErrors(refDestructuringErrors) || skipArrowSubscripts) { return expr }
if (expr.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")")
{ return expr }
var result = this.parseSubscripts(expr, startPos, startLoc);
if (refDestructuringErrors && result.type === "MemberExpression") {
if (refDestructuringErrors.parenthesizedAssign >= result.start) { refDestructuringErrors.parenthesizedAssign = -1; }
Expand Down Expand Up @@ -2074,6 +2077,7 @@
var empty$1 = [];

pp$3.parseNew = function() {
if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword new"); }
var node = this.startNode();
var meta = this.parseIdent(true);
if (this.options.ecmaVersion >= 6 && this.eat(types.dot)) {
Expand Down Expand Up @@ -2442,7 +2446,7 @@
} else {
this.unexpected();
}
this.next();
this.next(!!liberal);
this.finishNode(node, "Identifier");
if (!liberal) {
this.checkUnreserved(node);
Expand Down Expand Up @@ -2473,7 +2477,7 @@

var node = this.startNode();
this.next();
node.argument = this.parseMaybeUnary(null, true);
node.argument = this.parseMaybeUnary(null, false);
return this.finishNode(node, "AwaitExpression")
};

Expand Down Expand Up @@ -2841,7 +2845,8 @@
if (!this.switchU || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l) {
return c
}
return (c << 10) + s.charCodeAt(i + 1) - 0x35FDC00
var next = s.charCodeAt(i + 1);
return next >= 0xDC00 && next <= 0xDFFF ? (c << 10) + next - 0x35FDC00 : c
};

RegExpValidationState.prototype.nextIndex = function nextIndex (i) {
Expand All @@ -2850,8 +2855,9 @@
if (i >= l) {
return l
}
var c = s.charCodeAt(i);
if (!this.switchU || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l) {
var c = s.charCodeAt(i), next;
if (!this.switchU || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l ||
(next = s.charCodeAt(i + 1)) < 0xDC00 || next > 0xDFFF) {
return i + 1
}
return i + 2
Expand Down Expand Up @@ -3750,7 +3756,9 @@
var pp$9 = Parser.prototype;


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

Expand Down Expand Up @@ -4127,7 +4135,6 @@
if (!startsWithDot && this.readInt(10) === null) { this.raise(start, "Invalid number"); }
var octal = this.pos - start >= 2 && this.input.charCodeAt(start) === 48;
if (octal && this.strict) { this.raise(start, "Invalid number"); }
if (octal && /[89]/.test(this.input.slice(start, this.pos))) { octal = false; }
var next = this.input.charCodeAt(this.pos);
if (!octal && !startsWithDot && this.options.ecmaVersion >= 11 && next === 110) {
var str$1 = this.input.slice(start, this.pos);
Expand All @@ -4136,6 +4143,7 @@
if (isIdentifierStart(this.fullCharCodeAtPos())) { this.raise(this.pos, "Identifier directly after number"); }
return this.finishToken(types.num, val$1)
}
if (octal && /[89]/.test(this.input.slice(start, this.pos))) { octal = false; }
if (next === 46 && !octal) {
++this.pos;
this.readInt(10);
Expand Down Expand Up @@ -4303,6 +4311,18 @@
case 10:
if (this.options.locations) { this.lineStart = this.pos; ++this.curLine; }
return ""
case 56:
case 57:
if (inTemplate) {
var codePos = this.pos - 1;

this.invalidStringToken(
codePos,
"Invalid escape sequence in template string"
);

return null
}
default:
if (ch >= 48 && ch <= 55) {
var octalStr = this.input.substr(this.pos - 1, 3).match(/^[0-7]+/)[0];
Expand Down Expand Up @@ -4372,7 +4392,6 @@
var word = this.readWord1();
var type = types.name;
if (this.keywords.test(word)) {
if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword " + word); }
type = keywords$1[word];
}
return this.finishToken(type, word)
Expand Down
6 changes: 3 additions & 3 deletions dist/gpu-browser.min.js

Large diffs are not rendered by default.

41 changes: 14 additions & 27 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gpu.js",
"version": "2.6.10",
"version": "2.6.11",
"description": "GPU Accelerated JavaScript",
"engines": {
"node": ">=8.0.0"
Expand All @@ -18,7 +18,7 @@
"test": "test"
},
"dependencies": {
"acorn": "^7.1.0",
"acorn": "^7.1.1",
"gl": "^4.4.1",
"gl-wiretap": "^0.6.2",
"gpu-mock.js": "^1.1.1"
Expand Down

0 comments on commit 20b456b

Please sign in to comment.