| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 880 | 880 |
| 881 private: | 881 private: |
| 882 Variable* var_; | 882 Variable* var_; |
| 883 Type type_; | 883 Type type_; |
| 884 int index_; | 884 int index_; |
| 885 }; | 885 }; |
| 886 | 886 |
| 887 | 887 |
| 888 class Property: public Expression { | 888 class Property: public Expression { |
| 889 public: | 889 public: |
| 890 Property(Expression* obj, Expression* key, int pos) | 890 // Synthetic properties are property lookups introduced by the system, |
| 891 : obj_(obj), key_(key), pos_(pos) { } | 891 // to objects that aren't visible to the user. Function calls to synthetic |
| 892 // properties should use the global object as receiver, not the base object |
| 893 // of the resolved Reference. |
| 894 enum Type { NORMAL, SYNTHETIC }; |
| 895 Property(Expression* obj, Expression* key, int pos, Type type = NORMAL) |
| 896 : obj_(obj), key_(key), pos_(pos), type_(type) { } |
| 892 | 897 |
| 893 virtual void Accept(AstVisitor* v); | 898 virtual void Accept(AstVisitor* v); |
| 894 | 899 |
| 895 // Type testing & conversion | 900 // Type testing & conversion |
| 896 virtual Property* AsProperty() { return this; } | 901 virtual Property* AsProperty() { return this; } |
| 897 | 902 |
| 898 virtual bool IsValidLeftHandSide() { return true; } | 903 virtual bool IsValidLeftHandSide() { return true; } |
| 899 | 904 |
| 900 Expression* obj() const { return obj_; } | 905 Expression* obj() const { return obj_; } |
| 901 Expression* key() const { return key_; } | 906 Expression* key() const { return key_; } |
| 902 int position() const { return pos_; } | 907 int position() const { return pos_; } |
| 908 bool is_synthetic() const { return type_ == SYNTHETIC; } |
| 903 | 909 |
| 904 // Returns a property singleton property access on 'this'. Used | 910 // Returns a property singleton property access on 'this'. Used |
| 905 // during preparsing. | 911 // during preparsing. |
| 906 static Property* this_property() { return &this_property_; } | 912 static Property* this_property() { return &this_property_; } |
| 907 | 913 |
| 908 private: | 914 private: |
| 909 Expression* obj_; | 915 Expression* obj_; |
| 910 Expression* key_; | 916 Expression* key_; |
| 911 int pos_; | 917 int pos_; |
| 918 Type type_; |
| 912 | 919 |
| 913 // Dummy property used during preparsing | 920 // Dummy property used during preparsing. |
| 914 static Property this_property_; | 921 static Property this_property_; |
| 915 }; | 922 }; |
| 916 | 923 |
| 917 | 924 |
| 918 class Call: public Expression { | 925 class Call: public Expression { |
| 919 public: | 926 public: |
| 920 Call(Expression* expression, | 927 Call(Expression* expression, |
| 921 ZoneList<Expression*>* arguments, | 928 ZoneList<Expression*>* arguments, |
| 922 int pos) | 929 int pos) |
| 923 : expression_(expression), | 930 : expression_(expression), |
| (...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1676 #undef DEF_VISIT | 1683 #undef DEF_VISIT |
| 1677 | 1684 |
| 1678 private: | 1685 private: |
| 1679 bool stack_overflow_; | 1686 bool stack_overflow_; |
| 1680 }; | 1687 }; |
| 1681 | 1688 |
| 1682 | 1689 |
| 1683 } } // namespace v8::internal | 1690 } } // namespace v8::internal |
| 1684 | 1691 |
| 1685 #endif // V8_AST_H_ | 1692 #endif // V8_AST_H_ |
| OLD | NEW |