Changeset 192768 in webkit for trunk/Source/JavaScriptCore/parser/Parser.cpp
- Timestamp:
- Nov 24, 2015, 5:43:14 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/parser/Parser.cpp
r192695 r192768 862 862 863 863 const Identifier* propertyName = nullptr; 864 TreeExpression propertyExpression = 0; 864 865 TreeDestructuringPattern innerPattern = 0; 865 866 JSTokenLocation location = m_token.m_location; … … 883 884 propertyName = m_token.m_data.ident; 884 885 wasString = true; 886 break; 887 case OPENBRACKET: 888 next(); 889 propertyExpression = parseAssignmentExpression(context); 890 failIfFalse(propertyExpression, "Cannot parse computed property name"); 891 matchOrFail(CLOSEBRACKET, "Expected ']' to end end a computed property name"); 885 892 break; 886 893 default: … … 909 916 failIfFalse(innerPattern, "Cannot parse this destructuring pattern"); 910 917 TreeExpression defaultValue = parseDefaultValueForDestructuringPattern(context); 911 ASSERT(propertyName); 912 context.appendObjectPatternEntry(objectPattern, location, wasString, *propertyName, innerPattern, defaultValue); 918 if (propertyExpression) 919 context.appendObjectPatternEntry(objectPattern, location, propertyExpression, innerPattern, defaultValue); 920 else { 921 ASSERT(propertyName); 922 context.appendObjectPatternEntry(objectPattern, location, wasString, *propertyName, innerPattern, defaultValue); 923 } 913 924 } while (consume(COMMA)); 914 925
Note:
See TracChangeset
for help on using the changeset viewer.