Skip to content

Commit 4cee419

Browse files
Nick Santoshns
authored andcommitted
surprise surprise!
the one cl i didn't bother writing good tests for is the one where i did a bad merge :) Committed by Nick Santos ------------- Created by MOE: http://code.google.com/p/moe-java MOE_MIGRATED_REVID=26403848
1 parent 1a6eee4 commit 4cee419

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/org/mozilla/javascript/Parser.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3205,6 +3205,7 @@ private ObjectLiteral objectLiteral()
32053205
|| "set".equals(propertyName))))
32063206
{
32073207
boolean isGet = "get".equals(propertyName);
3208+
entryKind = isGet ? GET_ENTRY : SET_ENTRY;
32083209
AstNode pname = objliteralProperty();
32093210
if (pname == null) {
32103211
propertyName = null;

testsrc/org/mozilla/javascript/tests/ParserTest.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,17 @@ public void testNestedOr() {
605605

606606
}
607607

608+
public void testObjectLitGetterAndSetter() {
609+
AstNode root = parse(
610+
"'use strict';\n" +
611+
"function App() {}\n" +
612+
"App.prototype = {\n" +
613+
" get appData() { return this.appData_; },\n" +
614+
" set appData(data) { this.appData_ = data; }\n" +
615+
"};");
616+
assertNotNull(root);
617+
}
618+
608619
public void testObjectLitLocation() {
609620
AstNode root = parse(
610621
"\nvar foo =\n" +

0 commit comments

Comments
 (0)