Created
April 18, 2011 03:43
-
-
Save jed/924775 to your computer and use it in GitHub Desktop.
"TypeError: Cannot convert object to primitive value"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ node test.js | |
node.js:134 | |
throw e; // process.nextTick error, or 'error' event on first tick | |
^ | |
TypeError: Cannot convert object to primitive value | |
at String.STRING_ADD_LEFT (native) | |
at isRegExp (util.js:287:14) | |
at format (util.js:184:11) | |
at util.js:216:19 | |
at Array.map (native) | |
at format (util.js:193:23) | |
at util.js:216:19 | |
at Array.map (native) | |
at format (util.js:193:23) | |
at util.js:216:19 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a = [] | |
a.unshift( global ) | |
console.log( a ) |
did you ever get this to work? Having the same issue..
this was fixed a long time ago by @koichik if i recall correctly.
node -e "a=[];a.unshift(global);a"
works for me now.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm getting this too. Did you come up with a solution?