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 2904 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2915 // let x; | 2915 // let x; |
2916 // x = x'; | 2916 // x = x'; |
2917 // b; | 2917 // b; |
2918 // } | 2918 // } |
2919 | 2919 |
2920 // TODO(keuchel): Move the temporary variable to the block scope, after | 2920 // TODO(keuchel): Move the temporary variable to the block scope, after |
2921 // implementing stack allocated block scoped variables. | 2921 // implementing stack allocated block scoped variables. |
2922 Factory* heap_factory = isolate()->factory(); | 2922 Factory* heap_factory = isolate()->factory(); |
2923 Handle<String> tempstr = | 2923 Handle<String> tempstr = |
2924 heap_factory->NewConsString(heap_factory->dot_for_string(), name); | 2924 heap_factory->NewConsString(heap_factory->dot_for_string(), name); |
2925 RETURN_IF_EMPTY_HANDLE_VALUE(isolate(), tempstr, 0); | |
2926 Handle<String> tempname = heap_factory->InternalizeString(tempstr); | 2925 Handle<String> tempname = heap_factory->InternalizeString(tempstr); |
2927 Variable* temp = scope_->DeclarationScope()->NewTemporary(tempname); | 2926 Variable* temp = scope_->DeclarationScope()->NewTemporary(tempname); |
2928 VariableProxy* temp_proxy = factory()->NewVariableProxy(temp); | 2927 VariableProxy* temp_proxy = factory()->NewVariableProxy(temp); |
2929 ForEachStatement* loop = | 2928 ForEachStatement* loop = |
2930 factory()->NewForEachStatement(mode, labels, pos); | 2929 factory()->NewForEachStatement(mode, labels, pos); |
2931 Target target(&this->target_stack_, loop); | 2930 Target target(&this->target_stack_, loop); |
2932 | 2931 |
2933 // The expression does not see the loop variable. | 2932 // The expression does not see the loop variable. |
2934 scope_ = saved_scope; | 2933 scope_ = saved_scope; |
2935 Expression* enumerable = ParseExpression(true, CHECK_OK); | 2934 Expression* enumerable = ParseExpression(true, CHECK_OK); |
(...skipping 1963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4899 ASSERT(info()->isolate()->has_pending_exception()); | 4898 ASSERT(info()->isolate()->has_pending_exception()); |
4900 } else { | 4899 } else { |
4901 result = ParseProgram(); | 4900 result = ParseProgram(); |
4902 } | 4901 } |
4903 } | 4902 } |
4904 info()->SetFunction(result); | 4903 info()->SetFunction(result); |
4905 return (result != NULL); | 4904 return (result != NULL); |
4906 } | 4905 } |
4907 | 4906 |
4908 } } // namespace v8::internal | 4907 } } // namespace v8::internal |
OLD | NEW |