javascript - Object doesn't support this action - all of a sudden -


i'm running version 1.7.5 , incomprehensible reason, of sudden i'm getting syntax errors (none of stylesheets have changed since working) , i'm including .js file in same way):

object doesn't support action

i've traced error curious fragment (line 7880):

new(less.parser)(env).parse(data, function (e, root) {     if (e) { return callback(e, null, null, sheet); }     try {         callback(e, root, data, sheet, webinfo, path);     } catch (e) {         callback(e, null, null, sheet);     } }, {modifyvars: modifyvars, globalvars: less.globalvars}); 

...in loadstylesheet function. don't understand syntax, in fact, , trying @ console same error message:

new(less.parser) # fails new(less.parser)(env) # fails typeof less.parser # yields "function" 

what going on here?

description: "object doesn't support action" message: "object doesn't support action" number: -2146827843 stack: "typeerror: object doesn't support action\n @ parser (http://localhost:53109/scripts/system/less-1.7.5.js:360:5)\n @ anonymous function (http://localhost:53109/scripts/system/less-1.7.5.js:7880:13)\n @ anonymous function (http://localhost:53109/scripts/system/less-1.7.5.js:7838:13)\n @ handleresponse (http://localhost:53109/scripts/system/less-1.7.5.js:7763:13)\n @ doxhr (http://localhost:53109/scripts/system/less-1.7.5.js:7783:9)\n
@ loadfile (http://localhost:53109/scripts/system/less-1.7.5.js:7832:5)\n @ loadstylesheet (http://localhost:53109/scripts/system/less-1.7.5.js:7856:5)\n @ loadstylesheets (http://localhost:53109/scripts/system/less-1.7.5.js:7896:9)\n @ less.refresh (http://localhost:53109/scripts/system/less-1.7.5.js:7973:5)\n @ anonymous function (http://localhost:53109/scripts/system/less-1.7.5.js:7999:1)"

* update *

so syntax seems ok. can do:

new(function() {})('x') 

so given less.parser function code should work... doesn't. here's if @ less.parser:

function parser(env) {     var input,       // less input string         i,           // current index in `input`         j,           // current chunk         savestack = [],   // holds state backtracking         furthest,    // furthest index par     [methods]: {...}     __proto__:  function() {     [native code] }      arguments: null     caller: null     length: 1     prototype: {...} 

does amiss?

* update ii *

realising 1.7.5 far behind current, upgraded 2.5.0 (right off cdn) breaks elsewhere (line 2440):

if (typeof object.create === 'undefined') {     var f = function () {};     f.prototype = error.prototype;     lesserror.prototype = new f(); } else {     lesserror.prototype = object.create(error.prototype); # breaks here } 

with error:

object.create: argument not object , not null

and if @ error.prototype undefined... grr...

after bit of wailing , gnashing of teeth figured out. 1 of scripts setting:

var error = {}; 

lesson learned: beware variable names! have been nice if compiler had complained it.


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -