Permalink
Browse files

strict json checks

  • Loading branch information...
1 parent 29a9edb commit 1330f7d642a1fefc6dc7424e24df3942a7113166 @chjj chjj committed Oct 18, 2011
Showing with 6 additions and 0 deletions.
  1. +6 −0 lib/json.js
View
@@ -383,9 +383,15 @@ Parser.prototype.assemble = function(type, val) {
this.stack.push(object);
break;
case 'object key':
+ if (this.key) {
+ return this._unexpected(type);
+ }
this.key = val;
break;
case 'object end':
+ if (this.key) {
+ return this._unexpected(type);
+ }
this.emit('object', this.stack.pop());
break;
case 'array start':

0 comments on commit 1330f7d

Please sign in to comment.