Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

regexps aren't callable (any more, as of node 0.5) #16

Closed
isaacs opened this issue Aug 3, 2011 · 1 comment
Closed

regexps aren't callable (any more, as of node 0.5) #16

isaacs opened this issue Aug 3, 2011 · 1 comment
Assignees

Comments

@isaacs
Copy link
Contributor

isaacs commented Aug 3, 2011

This fixes it:

diff --git a/bin/json b/bin/json
index 14c51c1..2a37446 100755
--- a/bin/json
+++ b/bin/json
@@ -268,7 +268,7 @@ function processDatum(datum, args) {
       var bit = bits[i];
       if (bit[0] === '[') {
         lookup += bit;
-      } else if (! isJSIdentifier(bits[i])) {
+      } else if (! isJSIdentifier.exec(bits[i])) {
         // Allow a non-JS-indentifier token, e.g. `json foo-bar`.
         lookup += '["' + bits[i].replace('"', '\\"') + '"]';
       } else {
@@ -330,7 +330,7 @@ function processDatumExperimental(datum, args) {
         data = newdata;
       } else if (bit[0] === '[') {
         lookup += bit;
-      } else if (! isJSIdentifier(bits[i])) {
+      } else if (! isJSIdentifier.exec(bits[i])) {
         // Allow a non-JS-indentifier token, e.g. `json foo-bar`.
         lookup += '["' + bits[i].replace('"', '\\"') + '"]';
       } else {
@ghost ghost assigned trentm Aug 4, 2011
@trentm
Copy link
Owner

trentm commented Aug 4, 2011

Fixed in json 1.3.2 (tagged and npm-published).

commit 5b2fc3b

@trentm trentm closed this as completed Aug 4, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants