Skip to content

Commit d11d708

Browse files
committed
fix unary precendence error when silent mode is activated and unary node not defined yet
1 parent 4031421 commit d11d708

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

dist/php-parser.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! php-parser - BSD3 License - 2017-03-06 */
1+
/*! php-parser - BSD3 License - 2017-03-08 */
22

33
require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
44
// shim for using process in browser
@@ -366,7 +366,7 @@ AST.prototype.prepare = function(kind, parser) {
366366
if (out) { // shift with precedence
367367
result = out;
368368
}
369-
} else if (result.kind === 'unary') {
369+
} else if (result.kind === 'unary' && result.what) {
370370
var out = result.precedence(result.what);
371371
if (out) { // shift with precedence
372372
result = out;

dist/php-parser.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/php-parser.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "php-parser",
3-
"version": "2.0.1",
3+
"version": "2.0.2",
44
"description": "Parse PHP code and returns its AST",
55
"main": "src/index.js",
66
"scripts": {

src/ast.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ AST.prototype.prepare = function(kind, parser) {
181181
if (out) { // shift with precedence
182182
result = out;
183183
}
184-
} else if (result.kind === 'unary') {
184+
} else if (result.kind === 'unary' && result.what) {
185185
var out = result.precedence(result.what);
186186
if (out) { // shift with precedence
187187
result = out;

0 commit comments

Comments
 (0)