Comparing version 0.2.4 to 0.2.5
@@ -1,4 +0,4 @@ | ||
/*jsep - v0.2.3*/ | ||
/*jsep - v0.2.5*/ | ||
// JavaScript Expression Parser (JSEP) 0.2.3 | ||
// JavaScript Expression Parser (JSEP) 0.2.5 | ||
// JSEP may be freely distributed under the MIT License | ||
@@ -88,3 +88,3 @@ // http://jsep.from.so/ | ||
// `expr` is a string with the passed in expression | ||
do_parse = function(expr) { | ||
jsep = function(expr) { | ||
// `index` stores the character number we are currently at while `length` is a constant | ||
@@ -439,12 +439,12 @@ // All of the gobbles below will modify `index` as we move along | ||
// To be filled in by the template | ||
do_parse.version = '0.2.3'; | ||
do_parse.toString = function() { return 'JavaScript Expression Parser (JSEP) v' + do_parse.version; }; | ||
jsep.version = '0.2.5'; | ||
jsep.toString = function() { return 'JavaScript Expression Parser (JSEP) v' + jsep.version; }; | ||
// In desktop environments, have a way to restore the old value for `jsep` | ||
if (typeof root['export'] === 'undefined') { | ||
if (typeof exports === 'undefined') { | ||
var old_jsep = root.jsep; | ||
// The star of the show! It's a function! | ||
root.jsep = do_parse; | ||
root.jsep = jsep; | ||
// And a curteous function willing to move out of the way for other similary-namaed objects! | ||
do_parse.noConflict = function() { | ||
jsep.noConflict = function() { | ||
var jsep = root.jsep; | ||
@@ -456,7 +456,7 @@ root.jsep = old_jsep; | ||
// In Node.JS environments | ||
if (typeof root.module !== 'undefined' && module.exports) { | ||
exports = module.exports = do_parse; | ||
if (typeof module !== 'undefined' && module.exports) { | ||
exports = module.exports = jsep; | ||
} | ||
exports.parse = do_parse; | ||
exports.parse = jsep; | ||
} | ||
}(this)); |
@@ -1,4 +0,4 @@ | ||
/*jsep - v0.2.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.3",u.toString=function(){return"JavaScript Expression Parser (JSEP) v"+u.version},"undefined"==typeof a["export"]){var v=a.jsep;a.jsep=u,u.noConflict=function(){var b=a.jsep;return a.jsep=v,b}}else"undefined"!=typeof a.module&&module.exports&&(exports=module.exports=u),exports.parse=u}(this); | ||
!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); | ||
//# sourceMappingURL=jsep.min.js.map |
{ | ||
"name": "jsep", | ||
"description": "JavaScript Expression Parser", | ||
"version": "0.2.4", | ||
"version": "0.2.5", | ||
"author": "Stephen Oney (Carnegie Mellon)", | ||
@@ -6,0 +6,0 @@ "maintainers": [{ |
@@ -87,3 +87,3 @@ | ||
// `expr` is a string with the passed in expression | ||
do_parse = function(expr) { | ||
jsep = function(expr) { | ||
// `index` stores the character number we are currently at while `length` is a constant | ||
@@ -438,12 +438,12 @@ // All of the gobbles below will modify `index` as we move along | ||
// To be filled in by the template | ||
do_parse.version = '<%= version %>'; | ||
do_parse.toString = function() { return 'JavaScript Expression Parser (JSEP) v' + do_parse.version; }; | ||
jsep.version = '<%= version %>'; | ||
jsep.toString = function() { return 'JavaScript Expression Parser (JSEP) v' + jsep.version; }; | ||
// In desktop environments, have a way to restore the old value for `jsep` | ||
if (typeof root['export'] === 'undefined') { | ||
if (typeof exports === 'undefined') { | ||
var old_jsep = root.jsep; | ||
// The star of the show! It's a function! | ||
root.jsep = do_parse; | ||
root.jsep = jsep; | ||
// And a curteous function willing to move out of the way for other similary-namaed objects! | ||
do_parse.noConflict = function() { | ||
jsep.noConflict = function() { | ||
var jsep = root.jsep; | ||
@@ -455,7 +455,8 @@ root.jsep = old_jsep; | ||
// In Node.JS environments | ||
if (typeof root.module !== 'undefined' && module.exports) { | ||
exports = module.exports = do_parse; | ||
if (typeof module !== 'undefined' && module.exports) { | ||
exports = module.exports = jsep; | ||
} else { | ||
exports.parse = jsep; | ||
} | ||
exports.parse = do_parse; | ||
} | ||
}(this)); |
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
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
6789
241578