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 1567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1578 Property* property = assignment->target()->AsProperty(); | 1578 Property* property = assignment->target()->AsProperty(); |
1579 return assignment->op() == Token::ASSIGN | 1579 return assignment->op() == Token::ASSIGN |
1580 && property != NULL | 1580 && property != NULL |
1581 && property->obj()->AsVariableProxy() != NULL | 1581 && property->obj()->AsVariableProxy() != NULL |
1582 && property->obj()->AsVariableProxy()->is_this(); | 1582 && property->obj()->AsVariableProxy()->is_this(); |
1583 } | 1583 } |
1584 return false; | 1584 return false; |
1585 } | 1585 } |
1586 | 1586 |
1587 void HandleThisPropertyAssignment(Scope* scope, Assignment* assignment) { | 1587 void HandleThisPropertyAssignment(Scope* scope, Assignment* assignment) { |
1588 // Check that the property assigned to is a named property. | 1588 // Check that the property assigned to is a named property, which is not |
| 1589 // __proto__. |
1589 Property* property = assignment->target()->AsProperty(); | 1590 Property* property = assignment->target()->AsProperty(); |
1590 ASSERT(property != NULL); | 1591 ASSERT(property != NULL); |
1591 Literal* literal = property->key()->AsLiteral(); | 1592 Literal* literal = property->key()->AsLiteral(); |
1592 uint32_t dummy; | 1593 uint32_t dummy; |
1593 if (literal != NULL && | 1594 if (literal != NULL && |
1594 literal->handle()->IsString() && | 1595 literal->handle()->IsString() && |
| 1596 !String::cast(*(literal->handle()))->Equals(Heap::Proto_symbol()) && |
1595 !String::cast(*(literal->handle()))->AsArrayIndex(&dummy)) { | 1597 !String::cast(*(literal->handle()))->AsArrayIndex(&dummy)) { |
1596 Handle<String> key = Handle<String>::cast(literal->handle()); | 1598 Handle<String> key = Handle<String>::cast(literal->handle()); |
1597 | 1599 |
1598 // Check whether the value assigned is either a constant or matches the | 1600 // Check whether the value assigned is either a constant or matches the |
1599 // name of one of the arguments to the function. | 1601 // name of one of the arguments to the function. |
1600 if (assignment->value()->AsLiteral() != NULL) { | 1602 if (assignment->value()->AsLiteral() != NULL) { |
1601 // Constant assigned. | 1603 // Constant assigned. |
1602 Literal* literal = assignment->value()->AsLiteral(); | 1604 Literal* literal = assignment->value()->AsLiteral(); |
1603 AssignmentFromConstant(key, literal->handle()); | 1605 AssignmentFromConstant(key, literal->handle()); |
1604 return; | 1606 return; |
(...skipping 3537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5142 parser.ParseLazy(script_source, name, | 5144 parser.ParseLazy(script_source, name, |
5143 start_position, end_position, is_expression); | 5145 start_position, end_position, is_expression); |
5144 return result; | 5146 return result; |
5145 } | 5147 } |
5146 | 5148 |
5147 | 5149 |
5148 #undef NEW | 5150 #undef NEW |
5149 | 5151 |
5150 | 5152 |
5151 } } // namespace v8::internal | 5153 } } // namespace v8::internal |
OLD | NEW |