Changeset 187108 in webkit for trunk/Source/JavaScriptCore/parser/Parser.cpp
- Timestamp:
- Jul 21, 2015, 11:18:42 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/parser/Parser.cpp
r187014 r187108 2884 2884 #endif 2885 2885 2886 bool baseIsNewTarget = false; 2887 if (newCount && match(DOT)) { 2888 next(); 2889 if (match(IDENT)) { 2890 const Identifier* ident = m_token.m_data.ident; 2891 if (m_vm->propertyNames->target == *ident) { 2892 semanticFailIfFalse(currentScope()->isFunction(), "new.target is only valid inside functions"); 2893 baseIsNewTarget = true; 2894 base = context.newTargetExpr(location); 2895 newCount--; 2896 next(); 2897 } else 2898 failWithMessage("\"new.\" can only followed with target"); 2899 } else 2900 failDueToUnexpectedToken(); 2901 } 2902 2886 2903 if (baseIsSuper) { 2887 2904 base = context.superExpr(location); 2888 2905 next(); 2889 2906 currentScope()->setNeedsSuperBinding(); 2890 } else 2907 } else if (!baseIsNewTarget) 2891 2908 base = parsePrimaryExpression(context); 2892 2909
Note:
See TracChangeset
for help on using the changeset viewer.