Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(411)

Side by Side Diff: src/preparser.h

Issue 1060883004: [strong] Implement static restrictions on binding 'undefined' in arrow functions (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: linebreak Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/parser.cc ('k') | src/preparser.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_PREPARSER_H 5 #ifndef V8_PREPARSER_H
6 #define V8_PREPARSER_H 6 #define V8_PREPARSER_H
7 7
8 #include "src/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/bailout-reason.h" 10 #include "src/bailout-reason.h"
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 Traits::ReportMessageAt(function_name_loc, "strong_undefined"); 488 Traits::ReportMessageAt(function_name_loc, "strong_undefined");
489 *ok = false; 489 *ok = false;
490 return; 490 return;
491 } 491 }
492 } 492 }
493 493
494 // Checking the parameter names of a function literal. This has to be done 494 // Checking the parameter names of a function literal. This has to be done
495 // after parsing the function, since the function can declare itself strict. 495 // after parsing the function, since the function can declare itself strict.
496 void CheckFunctionParameterNames(LanguageMode language_mode, 496 void CheckFunctionParameterNames(LanguageMode language_mode,
497 bool strict_params, 497 bool strict_params,
498 const Scanner::Location& eval_args_error_loc, 498 const Scanner::Location& eval_args_loc,
499 const Scanner::Location& undefined_error_loc, 499 const Scanner::Location& undefined_loc,
500 const Scanner::Location& dupe_error_loc, 500 const Scanner::Location& dupe_loc,
501 const Scanner::Location& reserved_loc, 501 const Scanner::Location& reserved_loc,
502 bool* ok) { 502 bool* ok) {
503 if (is_sloppy(language_mode) && !strict_params) return; 503 if (is_sloppy(language_mode) && !strict_params) return;
504 504 if (is_strict(language_mode) && eval_args_loc.IsValid()) {
505 if (is_strict(language_mode) && eval_args_error_loc.IsValid()) { 505 Traits::ReportMessageAt(eval_args_loc, "strict_eval_arguments");
506 Traits::ReportMessageAt(eval_args_error_loc, "strict_eval_arguments");
507 *ok = false; 506 *ok = false;
508 return; 507 return;
509 } 508 }
510 if (is_strong(language_mode) && undefined_error_loc.IsValid()) { 509 if (is_strong(language_mode) && undefined_loc.IsValid()) {
511 Traits::ReportMessageAt(eval_args_error_loc, "strong_undefined"); 510 Traits::ReportMessageAt(undefined_loc, "strong_undefined");
512 *ok = false; 511 *ok = false;
513 return; 512 return;
514 } 513 }
515 // TODO(arv): When we add support for destructuring in setters we also need 514 // TODO(arv): When we add support for destructuring in setters we also need
516 // to check for duplicate names. 515 // to check for duplicate names.
517 if (dupe_error_loc.IsValid()) { 516 if (dupe_loc.IsValid()) {
518 Traits::ReportMessageAt(dupe_error_loc, "strict_param_dupe"); 517 Traits::ReportMessageAt(dupe_loc, "strict_param_dupe");
519 *ok = false; 518 *ok = false;
520 return; 519 return;
521 } 520 }
522 if (reserved_loc.IsValid()) { 521 if (reserved_loc.IsValid()) {
523 Traits::ReportMessageAt(reserved_loc, "unexpected_strict_reserved"); 522 Traits::ReportMessageAt(reserved_loc, "unexpected_strict_reserved");
524 *ok = false; 523 *ok = false;
525 return; 524 return;
526 } 525 }
527 } 526 }
528 527
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
750 bool IsStatic() const { return type_ == kStaticIdentifier; } 749 bool IsStatic() const { return type_ == kStaticIdentifier; }
751 bool IsYield() const { return type_ == kYieldIdentifier; } 750 bool IsYield() const { return type_ == kYieldIdentifier; }
752 bool IsPrototype() const { return type_ == kPrototypeIdentifier; } 751 bool IsPrototype() const { return type_ == kPrototypeIdentifier; }
753 bool IsConstructor() const { return type_ == kConstructorIdentifier; } 752 bool IsConstructor() const { return type_ == kConstructorIdentifier; }
754 bool IsFutureReserved() const { return type_ == kFutureReservedIdentifier; } 753 bool IsFutureReserved() const { return type_ == kFutureReservedIdentifier; }
755 bool IsFutureStrictReserved() const { 754 bool IsFutureStrictReserved() const {
756 return type_ == kFutureStrictReservedIdentifier || 755 return type_ == kFutureStrictReservedIdentifier ||
757 type_ == kLetIdentifier || type_ == kStaticIdentifier || 756 type_ == kLetIdentifier || type_ == kStaticIdentifier ||
758 type_ == kYieldIdentifier; 757 type_ == kYieldIdentifier;
759 } 758 }
760 V8_INLINE bool IsValidArrowParam() const {
761 // A valid identifier can be an arrow function parameter
762 // except for eval, arguments, yield, and reserved keywords.
763 return !(IsEval() || IsArguments() || IsFutureStrictReserved());
764 }
765 759
766 // Allow identifier->name()[->length()] to work. The preparser 760 // Allow identifier->name()[->length()] to work. The preparser
767 // does not need the actual positions/lengths of the identifiers. 761 // does not need the actual positions/lengths of the identifiers.
768 const PreParserIdentifier* operator->() const { return this; } 762 const PreParserIdentifier* operator->() const { return this; }
769 const PreParserIdentifier raw_name() const { return *this; } 763 const PreParserIdentifier raw_name() const { return *this; }
770 764
771 int position() const { return 0; } 765 int position() const { return 0; }
772 int length() const { return 0; } 766 int length() const { return 0; }
773 767
774 private: 768 private:
775 enum Type { 769 enum Type {
776 kUnknownIdentifier, 770 kUnknownIdentifier,
777 kFutureReservedIdentifier, 771 kFutureReservedIdentifier,
778 kFutureStrictReservedIdentifier, 772 kFutureStrictReservedIdentifier,
779 kLetIdentifier, 773 kLetIdentifier,
780 kStaticIdentifier, 774 kStaticIdentifier,
781 kYieldIdentifier, 775 kYieldIdentifier,
782 kEvalIdentifier, 776 kEvalIdentifier,
783 kArgumentsIdentifier, 777 kArgumentsIdentifier,
784 kUndefinedIdentifier, 778 kUndefinedIdentifier,
785 kPrototypeIdentifier, 779 kPrototypeIdentifier,
786 kConstructorIdentifier 780 kConstructorIdentifier
787 }; 781 };
782
788 explicit PreParserIdentifier(Type type) : type_(type) {} 783 explicit PreParserIdentifier(Type type) : type_(type) {}
789 Type type_; 784 Type type_;
790 785
791 friend class PreParserExpression; 786 friend class PreParserExpression;
792 }; 787 };
793 788
794 789
795 class PreParserExpression { 790 class PreParserExpression {
796 public: 791 public:
797 static PreParserExpression Default() { 792 static PreParserExpression Default() {
798 return PreParserExpression(TypeField::encode(kExpression)); 793 return PreParserExpression(TypeField::encode(kExpression));
799 } 794 }
800 795
801 static PreParserExpression Spread(PreParserExpression expression) { 796 static PreParserExpression Spread(PreParserExpression expression) {
802 return PreParserExpression(TypeField::encode(kSpreadExpression)); 797 return PreParserExpression(TypeField::encode(kSpreadExpression));
803 } 798 }
804 799
805 static PreParserExpression FromIdentifier(PreParserIdentifier id) { 800 static PreParserExpression FromIdentifier(PreParserIdentifier id) {
806 return PreParserExpression(TypeField::encode(kIdentifierExpression) | 801 return PreParserExpression(TypeField::encode(kIdentifierExpression) |
807 IdentifierTypeField::encode(id.type_)); 802 IdentifierTypeField::encode(id.type_));
808 } 803 }
809 804
810 static PreParserExpression BinaryOperation(PreParserExpression left, 805 static PreParserExpression BinaryOperation(PreParserExpression left,
811 Token::Value op, 806 Token::Value op,
812 PreParserExpression right) { 807 PreParserExpression right) {
813 bool valid_arrow_param_list = 808 ValidArrowParam valid_arrow_param_list =
814 op == Token::COMMA && !left.is_parenthesized() && 809 (op == Token::COMMA && !left.is_parenthesized() &&
815 !right.is_parenthesized() && left.IsValidArrowParams() && 810 !right.is_parenthesized()) ?
816 right.IsValidArrowParams(); 811 std::min(left.ValidateArrowParams(), right.ValidateArrowParams())
812 : kInvalidArrowParam;
817 return PreParserExpression( 813 return PreParserExpression(
818 TypeField::encode(kBinaryOperationExpression) | 814 TypeField::encode(kBinaryOperationExpression) |
819 IsValidArrowParamListField::encode(valid_arrow_param_list)); 815 IsValidArrowParamListField::encode(valid_arrow_param_list));
820 } 816 }
821 817
822 static PreParserExpression EmptyArrowParamList() { 818 static PreParserExpression EmptyArrowParamList() {
823 // Any expression for which IsValidArrowParamList() returns true 819 // Any expression for which IsValidArrowParamList() returns true
824 // will work here. 820 // will work here.
825 return FromIdentifier(PreParserIdentifier::Default()); 821 return FromIdentifier(PreParserIdentifier::Default());
826 } 822 }
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
908 904
909 bool IsCall() const { 905 bool IsCall() const {
910 return TypeField::decode(code_) == kExpression && 906 return TypeField::decode(code_) == kExpression &&
911 ExpressionTypeField::decode(code_) == kCallExpression; 907 ExpressionTypeField::decode(code_) == kCallExpression;
912 } 908 }
913 909
914 bool IsValidReferenceExpression() const { 910 bool IsValidReferenceExpression() const {
915 return IsIdentifier() || IsProperty(); 911 return IsIdentifier() || IsProperty();
916 } 912 }
917 913
918 bool IsValidArrowParamList() const { 914 bool IsValidArrowParamList(Scanner::Location* undefined_loc) const {
919 return IsValidArrowParams() && 915 ValidArrowParam valid = ValidateArrowParams();
920 ParenthesizationField::decode(code_) != 916 if (ParenthesizationField::decode(code_) == kMultiParenthesizedExpression) {
921 kMultiParenthesizedExpression; 917 return false;
918 }
919 if (valid == kValidArrowParam) {
920 return true;
921 } else if (valid == kInvalidStrongArrowParam) {
922 // Return true for now regardless of strong mode for compatibility with
923 // parser.
924 *undefined_loc = Scanner::Location();
925 return true;
926 } else {
927 return false;
928 }
922 } 929 }
923 930
924 // At the moment PreParser doesn't track these expression types. 931 // At the moment PreParser doesn't track these expression types.
925 bool IsFunctionLiteral() const { return false; } 932 bool IsFunctionLiteral() const { return false; }
926 bool IsCallNew() const { return false; } 933 bool IsCallNew() const { return false; }
927 934
928 bool IsNoTemplateTag() const { 935 bool IsNoTemplateTag() const {
929 return TypeField::decode(code_) == kExpression && 936 return TypeField::decode(code_) == kExpression &&
930 ExpressionTypeField::decode(code_) == kNoTemplateTagExpression; 937 ExpressionTypeField::decode(code_) == kNoTemplateTagExpression;
931 } 938 }
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
977 }; 984 };
978 985
979 enum ExpressionType { 986 enum ExpressionType {
980 kThisExpression, 987 kThisExpression,
981 kThisPropertyExpression, 988 kThisPropertyExpression,
982 kPropertyExpression, 989 kPropertyExpression,
983 kCallExpression, 990 kCallExpression,
984 kNoTemplateTagExpression 991 kNoTemplateTagExpression
985 }; 992 };
986 993
994 enum ValidArrowParam {
995 kInvalidArrowParam,
996 kInvalidStrongArrowParam,
997 kValidArrowParam
998 };
999
987 explicit PreParserExpression(uint32_t expression_code) 1000 explicit PreParserExpression(uint32_t expression_code)
988 : code_(expression_code) {} 1001 : code_(expression_code) {}
989 1002
990 V8_INLINE bool IsValidArrowParams() const { 1003 V8_INLINE ValidArrowParam ValidateArrowParams() const {
991 return IsBinaryOperation() 1004 if (IsBinaryOperation()) {
992 ? IsValidArrowParamListField::decode(code_) 1005 return IsValidArrowParamListField::decode(code_);
993 : (IsIdentifier() && AsIdentifier().IsValidArrowParam()); 1006 }
1007 if (!IsIdentifier()) {
1008 return kInvalidArrowParam;
1009 }
1010 PreParserIdentifier ident = AsIdentifier();
1011 // A valid identifier can be an arrow function parameter
1012 // except for eval, arguments, yield, and reserved keywords.
1013 if (ident.IsEval() || ident.IsArguments() ||
1014 ident.IsFutureStrictReserved()) {
1015 return kInvalidArrowParam;
1016 }
1017 // In strong mode, 'undefined' is similarly restricted.
1018 if (ident.IsUndefined()) {
1019 return kInvalidStrongArrowParam;
1020 }
1021 return kValidArrowParam;
994 } 1022 }
995 1023
996 // The first five bits are for the Type and Parenthesization. 1024 // The first five bits are for the Type and Parenthesization.
997 typedef BitField<Type, 0, 3> TypeField; 1025 typedef BitField<Type, 0, 3> TypeField;
998 typedef BitField<Parenthesization, TypeField::kNext, 2> ParenthesizationField; 1026 typedef BitField<Parenthesization, TypeField::kNext, 2> ParenthesizationField;
999 1027
1000 // The rest of the bits are interpreted depending on the value 1028 // The rest of the bits are interpreted depending on the value
1001 // of the Type field, so they can share the storage. 1029 // of the Type field, so they can share the storage.
1002 typedef BitField<ExpressionType, ParenthesizationField::kNext, 3> 1030 typedef BitField<ExpressionType, ParenthesizationField::kNext, 3>
1003 ExpressionTypeField; 1031 ExpressionTypeField;
1004 typedef BitField<bool, ParenthesizationField::kNext, 1> IsUseStrictField; 1032 typedef BitField<bool, ParenthesizationField::kNext, 1> IsUseStrictField;
1005 typedef BitField<bool, IsUseStrictField::kNext, 1> IsUseStrongField; 1033 typedef BitField<bool, IsUseStrictField::kNext, 1> IsUseStrongField;
1006 typedef BitField<bool, ParenthesizationField::kNext, 1> 1034 typedef BitField<ValidArrowParam, ParenthesizationField::kNext, 2>
1007 IsValidArrowParamListField; 1035 IsValidArrowParamListField;
1008 typedef BitField<PreParserIdentifier::Type, ParenthesizationField::kNext, 10> 1036 typedef BitField<PreParserIdentifier::Type, ParenthesizationField::kNext, 10>
1009 IdentifierTypeField; 1037 IdentifierTypeField;
1010 1038
1011 uint32_t code_; 1039 uint32_t code_;
1012 }; 1040 };
1013 1041
1014 1042
1015 // PreParserExpressionList doesn't actually store the expressions because 1043 // PreParserExpressionList doesn't actually store the expressions because
1016 // PreParser doesn't need to. 1044 // PreParser doesn't need to.
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
1484 } 1512 }
1485 1513
1486 V8_INLINE PreParserStatementList 1514 V8_INLINE PreParserStatementList
1487 ParseEagerFunctionBody(PreParserIdentifier function_name, int pos, 1515 ParseEagerFunctionBody(PreParserIdentifier function_name, int pos,
1488 Variable* fvar, Token::Value fvar_init_op, 1516 Variable* fvar, Token::Value fvar_init_op,
1489 FunctionKind kind, bool* ok); 1517 FunctionKind kind, bool* ok);
1490 1518
1491 // Utility functions 1519 // Utility functions
1492 int DeclareArrowParametersFromExpression(PreParserExpression expression, 1520 int DeclareArrowParametersFromExpression(PreParserExpression expression,
1493 Scope* scope, 1521 Scope* scope,
1522 Scanner::Location* undefined_loc,
1494 Scanner::Location* dupe_loc, 1523 Scanner::Location* dupe_loc,
1495 bool* ok) { 1524 bool* ok) {
1496 // TODO(aperez): Detect duplicated identifiers in paramlists. 1525 // TODO(aperez): Detect duplicated identifiers in paramlists.
1497 *ok = expression.IsValidArrowParamList(); 1526 *ok = expression.IsValidArrowParamList(undefined_loc);
1498 return 0; 1527 return 0;
1499 } 1528 }
1500 1529
1501 struct TemplateLiteralState {}; 1530 struct TemplateLiteralState {};
1502 1531
1503 TemplateLiteralState OpenTemplateLiteral(int pos) { 1532 TemplateLiteralState OpenTemplateLiteral(int pos) {
1504 return TemplateLiteralState(); 1533 return TemplateLiteralState();
1505 } 1534 }
1506 void AddTemplateSpan(TemplateLiteralState*, bool) {} 1535 void AddTemplateSpan(TemplateLiteralState*, bool) {}
1507 void AddTemplateExpression(TemplateLiteralState*, PreParserExpression) {} 1536 void AddTemplateExpression(TemplateLiteralState*, PreParserExpression) {}
(...skipping 1507 matching lines...) Expand 10 before | Expand all | Expand 10 after
3015 int num_parameters = -1; 3044 int num_parameters = -1;
3016 int materialized_literal_count = -1; 3045 int materialized_literal_count = -1;
3017 int expected_property_count = -1; 3046 int expected_property_count = -1;
3018 int handler_count = 0; 3047 int handler_count = 0;
3019 Scanner::Location super_loc; 3048 Scanner::Location super_loc;
3020 3049
3021 { 3050 {
3022 typename Traits::Type::Factory function_factory(ast_value_factory()); 3051 typename Traits::Type::Factory function_factory(ast_value_factory());
3023 FunctionState function_state(&function_state_, &scope_, scope, 3052 FunctionState function_state(&function_state_, &scope_, scope,
3024 kArrowFunction, &function_factory); 3053 kArrowFunction, &function_factory);
3025 Scanner::Location dupe_error_loc = Scanner::Location::invalid(); 3054 Scanner::Location undefined_loc = Scanner::Location::invalid();
3026 // TODO(arv): Pass in eval_args_error_loc and reserved_loc here. 3055 Scanner::Location dupe_loc = Scanner::Location::invalid();
3056 // TODO(arv): Pass in eval_args_loc and reserved_loc here.
3027 num_parameters = Traits::DeclareArrowParametersFromExpression( 3057 num_parameters = Traits::DeclareArrowParametersFromExpression(
3028 params_ast, scope_, &dupe_error_loc, ok); 3058 params_ast, scope_, &undefined_loc, &dupe_loc, ok);
3029 if (!*ok) { 3059 if (!*ok) {
3030 ReportMessageAt( 3060 ReportMessageAt(
3031 Scanner::Location(start_pos, scanner()->location().beg_pos), 3061 Scanner::Location(start_pos, scanner()->location().beg_pos),
3032 "malformed_arrow_function_parameter_list"); 3062 "malformed_arrow_function_parameter_list");
3033 return this->EmptyExpression(); 3063 return this->EmptyExpression();
3034 } 3064 }
3035 3065
3066 if (undefined_loc.IsValid()) {
3067 // Workaround for preparser not keeping track of positions.
3068 undefined_loc = Scanner::Location(start_pos,
3069 scanner()->location().end_pos);
3070 }
3036 if (num_parameters > Code::kMaxArguments) { 3071 if (num_parameters > Code::kMaxArguments) {
3037 ReportMessageAt(Scanner::Location(params_ast->position(), position()), 3072 ReportMessageAt(Scanner::Location(params_ast->position(), position()),
3038 "too_many_parameters"); 3073 "too_many_parameters");
3039 *ok = false; 3074 *ok = false;
3040 return this->EmptyExpression(); 3075 return this->EmptyExpression();
3041 } 3076 }
3042 3077
3043 Expect(Token::ARROW, CHECK_OK); 3078 Expect(Token::ARROW, CHECK_OK);
3044 3079
3045 if (peek() == Token::LBRACE) { 3080 if (peek() == Token::LBRACE) {
3046 // Multiple statemente body 3081 // Multiple statement body
3047 Consume(Token::LBRACE); 3082 Consume(Token::LBRACE);
3048 bool is_lazily_parsed = 3083 bool is_lazily_parsed =
3049 (mode() == PARSE_LAZILY && scope_->AllowsLazyCompilation()); 3084 (mode() == PARSE_LAZILY && scope_->AllowsLazyCompilation());
3050 if (is_lazily_parsed) { 3085 if (is_lazily_parsed) {
3051 body = this->NewStatementList(0, zone()); 3086 body = this->NewStatementList(0, zone());
3052 this->SkipLazyFunctionBody(this->EmptyIdentifier(), 3087 this->SkipLazyFunctionBody(this->EmptyIdentifier(),
3053 &materialized_literal_count, 3088 &materialized_literal_count,
3054 &expected_property_count, CHECK_OK); 3089 &expected_property_count, CHECK_OK);
3055 } else { 3090 } else {
3056 body = this->ParseEagerFunctionBody( 3091 body = this->ParseEagerFunctionBody(
(...skipping 14 matching lines...) Expand all
3071 materialized_literal_count = function_state.materialized_literal_count(); 3106 materialized_literal_count = function_state.materialized_literal_count();
3072 expected_property_count = function_state.expected_property_count(); 3107 expected_property_count = function_state.expected_property_count();
3073 handler_count = function_state.handler_count(); 3108 handler_count = function_state.handler_count();
3074 } 3109 }
3075 super_loc = function_state.super_call_location(); 3110 super_loc = function_state.super_call_location();
3076 3111
3077 scope->set_start_position(start_pos); 3112 scope->set_start_position(start_pos);
3078 scope->set_end_position(scanner()->location().end_pos); 3113 scope->set_end_position(scanner()->location().end_pos);
3079 3114
3080 // Arrow function *parameter lists* are always checked as in strict mode. 3115 // Arrow function *parameter lists* are always checked as in strict mode.
3081 // TODO(arv): eval_args_error_loc, undefined_error_loc, and reserved_loc 3116 // TODO(arv): eval_args_loc and reserved_loc needs to be set by
3082 // needs to be set by DeclareArrowParametersFromExpression. 3117 // DeclareArrowParametersFromExpression.
3083 Scanner::Location eval_args_error_loc = Scanner::Location::invalid(); 3118 Scanner::Location eval_args_loc = Scanner::Location::invalid();
3084 Scanner::Location undefined_error_loc = Scanner::Location::invalid();
3085 Scanner::Location reserved_loc = Scanner::Location::invalid(); 3119 Scanner::Location reserved_loc = Scanner::Location::invalid();
3086 const bool use_strict_params = true; 3120 const bool use_strict_params = true;
3087 this->CheckFunctionParameterNames(language_mode(), use_strict_params, 3121 this->CheckFunctionParameterNames(language_mode(), use_strict_params,
3088 eval_args_error_loc, undefined_error_loc, 3122 eval_args_loc, undefined_loc, dupe_loc,
3089 dupe_error_loc, reserved_loc, CHECK_OK); 3123 reserved_loc, CHECK_OK);
3090 3124
3091 // Validate strict mode. 3125 // Validate strict mode.
3092 if (is_strict(language_mode())) { 3126 if (is_strict(language_mode())) {
3093 CheckStrictOctalLiteral(start_pos, scanner()->location().end_pos, 3127 CheckStrictOctalLiteral(start_pos, scanner()->location().end_pos,
3094 CHECK_OK); 3128 CHECK_OK);
3095 this->CheckConflictingVarDeclarations(scope, CHECK_OK); 3129 this->CheckConflictingVarDeclarations(scope, CHECK_OK);
3096 } 3130 }
3097 } 3131 }
3098 3132
3099 FunctionLiteralT function_literal = factory()->NewFunctionLiteral( 3133 FunctionLiteralT function_literal = factory()->NewFunctionLiteral(
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
3292 *ok = false; 3326 *ok = false;
3293 return; 3327 return;
3294 } 3328 }
3295 has_seen_constructor_ = true; 3329 has_seen_constructor_ = true;
3296 return; 3330 return;
3297 } 3331 }
3298 } 3332 }
3299 } } // v8::internal 3333 } } // v8::internal
3300 3334
3301 #endif // V8_PREPARSER_H 3335 #endif // V8_PREPARSER_H
OLDNEW
« no previous file with comments | « src/parser.cc ('k') | src/preparser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698