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 3973 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3984 ReportUnexpectedToken(next); | 3984 ReportUnexpectedToken(next); |
3985 *ok = false; | 3985 *ok = false; |
3986 return NULL; | 3986 return NULL; |
3987 } | 3987 } |
3988 } | 3988 } |
3989 | 3989 |
3990 Expect(Token::COLON, CHECK_OK); | 3990 Expect(Token::COLON, CHECK_OK); |
3991 Expression* value = ParseAssignmentExpression(true, CHECK_OK); | 3991 Expression* value = ParseAssignmentExpression(true, CHECK_OK); |
3992 | 3992 |
3993 ObjectLiteral::Property* property = | 3993 ObjectLiteral::Property* property = |
3994 new(zone()) ObjectLiteral::Property(key, value); | 3994 new(zone()) ObjectLiteral::Property(key, value, isolate()); |
3995 | 3995 |
3996 // Mark top-level object literals that contain function literals and | 3996 // Mark top-level object literals that contain function literals and |
3997 // pretenure the literal so it can be added as a constant function | 3997 // pretenure the literal so it can be added as a constant function |
3998 // property. | 3998 // property. |
3999 if (top_scope_->DeclarationScope()->is_global_scope() && | 3999 if (top_scope_->DeclarationScope()->is_global_scope() && |
4000 value->AsFunctionLiteral() != NULL) { | 4000 value->AsFunctionLiteral() != NULL) { |
4001 has_function = true; | 4001 has_function = true; |
4002 value->AsFunctionLiteral()->set_pretenure(); | 4002 value->AsFunctionLiteral()->set_pretenure(); |
4003 } | 4003 } |
4004 | 4004 |
(...skipping 1804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5809 ASSERT(info->isolate()->has_pending_exception()); | 5809 ASSERT(info->isolate()->has_pending_exception()); |
5810 } else { | 5810 } else { |
5811 result = parser.ParseProgram(info); | 5811 result = parser.ParseProgram(info); |
5812 } | 5812 } |
5813 } | 5813 } |
5814 info->SetFunction(result); | 5814 info->SetFunction(result); |
5815 return (result != NULL); | 5815 return (result != NULL); |
5816 } | 5816 } |
5817 | 5817 |
5818 } } // namespace v8::internal | 5818 } } // namespace v8::internal |
OLD | NEW |