Comparing version 0.2.5 to 0.2.6
@@ -1,6 +0,4 @@ | ||
/*jsep - v0.2.5*/ | ||
// JavaScript Expression Parser (JSEP) 0.2.5 | ||
// JavaScript Expression Parser (JSEP) 0.2.6 | ||
// JSEP may be freely distributed under the MIT License | ||
// http://jsep.from.so/ | ||
// http://jsep.from.so/ | ||
@@ -108,4 +106,4 @@ /*global module: true, exports: true, console: true */ | ||
gobbleBinaryOp = function() { | ||
gobbleSpaces(); | ||
var biop, to_check = expr.substr(index, 3), tc_len = to_check.length; | ||
gobbleSpaces(); | ||
while(tc_len > 0) { | ||
@@ -439,3 +437,3 @@ if(binary_ops.hasOwnProperty(to_check)) { | ||
// To be filled in by the template | ||
jsep.version = '0.2.5'; | ||
jsep.version = '0.2.6'; | ||
jsep.toString = function() { return 'JavaScript Expression Parser (JSEP) v' + jsep.version; }; | ||
@@ -450,4 +448,5 @@ | ||
jsep.noConflict = function() { | ||
var jsep = root.jsep; | ||
root.jsep = old_jsep; | ||
if(root.jsep === jsep) { | ||
root.jsep = old_jsep; | ||
} | ||
return jsep; | ||
@@ -459,5 +458,6 @@ }; | ||
exports = module.exports = jsep; | ||
} else { | ||
exports.parse = jsep; | ||
} | ||
exports.parse = jsep; | ||
} | ||
}(this)); |
@@ -1,4 +0,3 @@ | ||
/*jsep - v0.2.5*/ | ||
!function(a){"use strict";var b="Compound",c="Identifier",d="MemberExpression",e="Literal",f="ThisExpression",g="CallExpression",h="UnaryExpression",i="BinaryExpression",j="LogicalExpression",k=!0,l={"-":k,"!":k,"~":k,"+":k},m={"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},n={"true":!0,"false":!1,"null":null},o="this",p=function(a){return m[a]||0},q=function(a,b,c){var d="||"===a||"&&"===a?j:i;return{type:d,operator:a,left:b,right:c}},r=function(a){return a>=48&&57>=a},s=function(a){return 36===a||95===a||a>=65&&90>=a||a>=97&&122>=a},t=function(a){return 36===a||95===a||a>=65&&90>=a||a>=97&&122>=a||a>=48&&57>=a},u=function(a){for(var i,j,k=0,u=a.length,v=function(){for(var b=a.charCodeAt(k);32===b||9===b;)b=a.charCodeAt(++k)},w=function(){var b=a.substr(k,3),c=b.length;for(v();c>0;){if(m.hasOwnProperty(b))return k+=c,b;b=b.substr(0,--c)}return!1},x=function(){var a,b,c,d,e,f,g,h;if(f=y(),b=w(),!b)return f;if(e={value:b,prec:p(b)},g=y(),!g)throw new Error("Expected expression after "+b+" at character "+k);for(d=[f,e,g];(b=w())&&(c=p(b),0!==c);){for(e={value:b,prec:c};d.length>2&&c<=d[d.length-2].prec;)g=d.pop(),b=d.pop().value,f=d.pop(),a=q(b,f,g),d.push(a);if(a=y(),!a)throw new Error("Expected expression after "+b+" at character "+k);d.push(e),d.push(a)}for(h=d.length-1,a=d[h];h>1;)a=q(d[h-1].value,d[h-2],a),h-=2;return a},y=function(){var b,c;return v(),c=a[k],b=a.charCodeAt(k),r(b)||46===b?z():39===b||34===b?A():s(b)?D():l.hasOwnProperty(c)?(k++,{type:h,operator:c,argument:y(),prefix:!0}):40===b?E():!1},z=function(){for(var b="";r(a.charCodeAt(k));)b+=a[k++];if("."===a[k])for(b+=a[k++];r(a.charCodeAt(k));)b+=a[k++];if(s(a.charCodeAt(k)))throw new Error("Variable names cannot start with a number ("+b+a[k]+") at character "+k);return{type:e,value:parseFloat(b),raw:b}},A=function(){for(var b,c="",d=a[k++],f=!1;u>k;){if(b=a[k++],b===d){f=!0;break}if("\\"===b)switch(b=a[k++]){case"n":c+="\n";break;case"r":c+="\r";break;case"t":c+=" ";break;case"b":c+="\b";break;case"f":c+="\f";break;case"v":c+=""}else c+=b}if(!f)throw new Error('Unclosed quote after "'+c+'"');return{type:e,value:c,raw:d+c+d}},B=function(){var b,d=a.charCodeAt(k),g=k;for(s(d)&&k++;u>k&&(d=a.charCodeAt(k),t(d));)k++;return b=a.slice(g,k),n.hasOwnProperty(b)?{type:e,value:n[b],raw:b}:b===o?{type:f}:{type:c,name:b}},C=function(){for(var c,d,e=[];u>k;){if(v(),c=a[k],")"===c){k++;break}if(","===c)k++;else{if(d=x(),!d||d.type===b)throw new Error("Expected comma at character "+k);e.push(d)}}return e},D=function(){var b,c,e;for(c=B(),b=a[k];"."===b||"["===b||"("===b;){if("."===b)k++,c={type:d,computed:!1,object:c,property:B()};else if("["===b){if(e=k,k++,c={type:d,computed:!0,object:c,property:x()},v(),b=a[k],"]"!==b)throw new Error("Unclosed [ at character "+k);k++}else"("===b&&(k++,c={type:g,arguments:C(),callee:c});b=a[k]}return c},E=function(){k++;var b=x();if(v(),")"===a[k])return k++,b;throw new Error("Unclosed ( at character "+k)},F=[];u>k;)if(i=a[k],";"===i||","===i)k++;else if(j=x())F.push(j);else if(u>k)throw new Error("Unexpected '"+a[k]+"' at character "+k);return 1===F.length?F[0]:{type:b,body:F}};if(u.version="0.2.5",u.toString=function(){return"JavaScript Expression Parser (JSEP) v"+u.version},"undefined"==typeof exports){var v=a.jsep;a.jsep=u,u.noConflict=function(){var b=a.jsep;return a.jsep=v,b}}else"undefined"!=typeof module&&module.exports&&(exports=module.exports=u),exports.parse=u}(this); | ||
/* jsep v0.2.6 (http://jsep.from.so/) */ | ||
!function(a){"use strict";var b="Compound",c="Identifier",d="MemberExpression",e="Literal",f="ThisExpression",g="CallExpression",h="UnaryExpression",i="BinaryExpression",j="LogicalExpression",k=!0,l={"-":k,"!":k,"~":k,"+":k},m={"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},n={"true":!0,"false":!1,"null":null},o="this",p=function(a){return m[a]||0},q=function(a,b,c){var d="||"===a||"&&"===a?j:i;return{type:d,operator:a,left:b,right:c}},r=function(a){return a>=48&&57>=a},s=function(a){return 36===a||95===a||a>=65&&90>=a||a>=97&&122>=a},t=function(a){return 36===a||95===a||a>=65&&90>=a||a>=97&&122>=a||a>=48&&57>=a},u=function(a){for(var i,j,k=0,u=a.length,v=function(){for(var b=a.charCodeAt(k);32===b||9===b;)b=a.charCodeAt(++k)},w=function(){v();for(var b=a.substr(k,3),c=b.length;c>0;){if(m.hasOwnProperty(b))return k+=c,b;b=b.substr(0,--c)}return!1},x=function(){var a,b,c,d,e,f,g,h;if(f=y(),b=w(),!b)return f;if(e={value:b,prec:p(b)},g=y(),!g)throw new Error("Expected expression after "+b+" at character "+k);for(d=[f,e,g];(b=w())&&(c=p(b),0!==c);){for(e={value:b,prec:c};d.length>2&&c<=d[d.length-2].prec;)g=d.pop(),b=d.pop().value,f=d.pop(),a=q(b,f,g),d.push(a);if(a=y(),!a)throw new Error("Expected expression after "+b+" at character "+k);d.push(e),d.push(a)}for(h=d.length-1,a=d[h];h>1;)a=q(d[h-1].value,d[h-2],a),h-=2;return a},y=function(){var b,c;return v(),c=a[k],b=a.charCodeAt(k),r(b)||46===b?z():39===b||34===b?A():s(b)?D():l.hasOwnProperty(c)?(k++,{type:h,operator:c,argument:y(),prefix:!0}):40===b?E():!1},z=function(){for(var b="";r(a.charCodeAt(k));)b+=a[k++];if("."===a[k])for(b+=a[k++];r(a.charCodeAt(k));)b+=a[k++];if(s(a.charCodeAt(k)))throw new Error("Variable names cannot start with a number ("+b+a[k]+") at character "+k);return{type:e,value:parseFloat(b),raw:b}},A=function(){for(var b,c="",d=a[k++],f=!1;u>k;){if(b=a[k++],b===d){f=!0;break}if("\\"===b)switch(b=a[k++]){case"n":c+="\n";break;case"r":c+="\r";break;case"t":c+=" ";break;case"b":c+="\b";break;case"f":c+="\f";break;case"v":c+=""}else c+=b}if(!f)throw new Error('Unclosed quote after "'+c+'"');return{type:e,value:c,raw:d+c+d}},B=function(){var b,d=a.charCodeAt(k),g=k;for(s(d)&&k++;u>k&&(d=a.charCodeAt(k),t(d));)k++;return b=a.slice(g,k),n.hasOwnProperty(b)?{type:e,value:n[b],raw:b}:b===o?{type:f}:{type:c,name:b}},C=function(){for(var c,d,e=[];u>k;){if(v(),c=a[k],")"===c){k++;break}if(","===c)k++;else{if(d=x(),!d||d.type===b)throw new Error("Expected comma at character "+k);e.push(d)}}return e},D=function(){var b,c,e;for(c=B(),b=a[k];"."===b||"["===b||"("===b;){if("."===b)k++,c={type:d,computed:!1,object:c,property:B()};else if("["===b){if(e=k,k++,c={type:d,computed:!0,object:c,property:x()},v(),b=a[k],"]"!==b)throw new Error("Unclosed [ at character "+k);k++}else"("===b&&(k++,c={type:g,arguments:C(),callee:c});b=a[k]}return c},E=function(){k++;var b=x();if(v(),")"===a[k])return k++,b;throw new Error("Unclosed ( at character "+k)},F=[];u>k;)if(i=a[k],";"===i||","===i)k++;else if(j=x())F.push(j);else if(u>k)throw new Error("Unexpected '"+a[k]+"' at character "+k);return 1===F.length?F[0]:{type:b,body:F}};if(u.version="0.2.6",u.toString=function(){return"JavaScript Expression Parser (JSEP) v"+u.version},"undefined"==typeof exports){var v=a.jsep;a.jsep=u,u.noConflict=function(){return a.jsep===u&&(a.jsep=v),u}}else"undefined"!=typeof module&&module.exports?exports=module.exports=u:exports.parse=u}(this); | ||
//# sourceMappingURL=jsep.min.js.map |
@@ -15,3 +15,3 @@ module.exports = function(grunt) { | ||
options: { | ||
banner: '/*<%= pkg.name %> - v<%= pkg.version %>*/\n', | ||
banner: '/* <%= pkg.name %> v<%= pkg.version %> (<%= pkg.homepage %>) */', | ||
report: 'gzip', | ||
@@ -29,3 +29,2 @@ sourceMap: "build/jsep.min.js.map", | ||
options: { | ||
banner: '/*<%= pkg.name %> - v<%= pkg.version %>*/\n', | ||
process: { | ||
@@ -32,0 +31,0 @@ data: { |
{ | ||
"name": "jsep", | ||
"version": "0.2.6", | ||
"description": "JavaScript Expression Parser", | ||
"version": "0.2.5", | ||
"author": "Stephen Oney (Carnegie Mellon)", | ||
"maintainers": [{ | ||
"name": "Stephen Oney", | ||
"email": "swloney@gmail.com", | ||
"web": "http://from.so/" | ||
}], | ||
"author": "Stephen Oney <swloney@gmail.com> (http://from.so/)", | ||
"homepage": "http://jsep.from.so/", | ||
"licenses": [{ | ||
@@ -15,2 +11,6 @@ "type": "MIT", | ||
}], | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/soney/jsep.git" | ||
}, | ||
"main": "build/jsep.js", | ||
@@ -17,0 +17,0 @@ "private": false, |
@@ -23,2 +23,4 @@ ##jsep: A JavaScript Expression Parser | ||
####Node.JS | ||
First, run `npm install jsep`. Then, in your source file: | ||
var jsep = require("jsep"); | ||
@@ -25,0 +27,0 @@ var parse_tree = jsep("1 + 1"); |
@@ -1,5 +0,4 @@ | ||
// JavaScript Expression Parser (JSEP) <%= version %> | ||
// JSEP may be freely distributed under the MIT License | ||
// http://jsep.from.so/ | ||
// http://jsep.from.so/ | ||
@@ -107,4 +106,4 @@ /*global module: true, exports: true, console: true */ | ||
gobbleBinaryOp = function() { | ||
gobbleSpaces(); | ||
var biop, to_check = expr.substr(index, 3), tc_len = to_check.length; | ||
gobbleSpaces(); | ||
while(tc_len > 0) { | ||
@@ -448,4 +447,5 @@ if(binary_ops.hasOwnProperty(to_check)) { | ||
jsep.noConflict = function() { | ||
var jsep = root.jsep; | ||
root.jsep = old_jsep; | ||
if(root.jsep === jsep) { | ||
root.jsep = old_jsep; | ||
} | ||
return jsep; | ||
@@ -452,0 +452,0 @@ }; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 8 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
650092
28
7514
33
0
8