We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0c19482 commit 0d0df08Copy full SHA for 0d0df08
src/ng/parse.js
@@ -806,7 +806,7 @@ Parser.prototype = {
806
break;
807
}
808
var token = this.expect();
809
- keys.push(token.string || token.text);
+ keys.push(isDefined(token.string) ? token.string : token.text);
810
this.consume(':');
811
var value = this.expression();
812
valueFns.push(value);
test/ng/parseSpec.js
@@ -511,6 +511,7 @@ describe('parser', function() {
511
expect(toJson(scope.$eval("{a:'b',}"))).toEqual('{"a":"b"}');
512
expect(toJson(scope.$eval("{'a':'b',}"))).toEqual('{"a":"b"}');
513
expect(toJson(scope.$eval("{\"a\":'b',}"))).toEqual('{"a":"b"}');
514
+ expect(toJson(scope.$eval('{"":"b",}'))).toEqual('{"":"b"}');
515
});
516
517
it('should evaluate object access', function() {
0 commit comments