OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
572 | 572 |
573 bool inside_with() const { return top_scope_->inside_with(); } | 573 bool inside_with() const { return top_scope_->inside_with(); } |
574 Scanner& scanner() { return scanner_; } | 574 Scanner& scanner() { return scanner_; } |
575 Mode mode() const { return mode_; } | 575 Mode mode() const { return mode_; } |
576 ScriptDataImpl* pre_data() const { return pre_data_; } | 576 ScriptDataImpl* pre_data() const { return pre_data_; } |
577 bool is_extended_mode() { | 577 bool is_extended_mode() { |
578 ASSERT(top_scope_ != NULL); | 578 ASSERT(top_scope_ != NULL); |
579 return top_scope_->is_extended_mode(); | 579 return top_scope_->is_extended_mode(); |
580 } | 580 } |
581 Scope* DeclarationScope(VariableMode mode) { | 581 Scope* DeclarationScope(VariableMode mode) { |
582 return (mode == LET || mode == CONST_HARMONY) | 582 return IsLexicalVariableMode(mode) |
583 ? top_scope_ : top_scope_->DeclarationScope(); | 583 ? top_scope_ : top_scope_->DeclarationScope(); |
584 } | 584 } |
585 | 585 |
586 // Check if the given string is 'eval' or 'arguments'. | 586 // Check if the given string is 'eval' or 'arguments'. |
587 bool IsEvalOrArguments(Handle<String> string); | 587 bool IsEvalOrArguments(Handle<String> string); |
588 | 588 |
589 // All ParseXXX functions take as the last argument an *ok parameter | 589 // All ParseXXX functions take as the last argument an *ok parameter |
590 // which is set to false if parsing failed; it is unchanged otherwise. | 590 // which is set to false if parsing failed; it is unchanged otherwise. |
591 // By making the 'exception handling' explicit, we are forced to check | 591 // By making the 'exception handling' explicit, we are forced to check |
592 // for failure at the call sites. | 592 // for failure at the call sites. |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
878 private: | 878 private: |
879 static const int kTypeSlot = 0; | 879 static const int kTypeSlot = 0; |
880 static const int kElementsSlot = 1; | 880 static const int kElementsSlot = 1; |
881 | 881 |
882 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); | 882 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); |
883 }; | 883 }; |
884 | 884 |
885 } } // namespace v8::internal | 885 } } // namespace v8::internal |
886 | 886 |
887 #endif // V8_PARSER_H_ | 887 #endif // V8_PARSER_H_ |
OLD | NEW |