Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Side by Side Diff: src/runtime.cc

Issue 342453002: Arguments object has @@iterator (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: rebased, adapted to getdataproperty change Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/contexts.h ('k') | test/mjsunit/es6/arguments-iterator.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stdlib.h> 5 #include <stdlib.h>
6 #include <limits> 6 #include <limits>
7 7
8 #include "src/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/accessors.h" 10 #include "src/accessors.h"
(...skipping 5993 matching lines...) Expand 10 before | Expand all | Expand 10 after
6004 6004
6005 // Try to convert the key to an index. If successful and within 6005 // Try to convert the key to an index. If successful and within
6006 // index return the the argument from the frame. 6006 // index return the the argument from the frame.
6007 uint32_t index; 6007 uint32_t index;
6008 if (raw_key->ToArrayIndex(&index) && index < n) { 6008 if (raw_key->ToArrayIndex(&index) && index < n) {
6009 return frame->GetParameter(index); 6009 return frame->GetParameter(index);
6010 } 6010 }
6011 6011
6012 HandleScope scope(isolate); 6012 HandleScope scope(isolate);
6013 if (raw_key->IsSymbol()) { 6013 if (raw_key->IsSymbol()) {
6014 Handle<Symbol> symbol = Handle<Symbol>::cast(raw_key);
6015 if (symbol->Equals(isolate->native_context()->iterator_symbol())) {
6016 return isolate->native_context()->array_values_iterator();
6017 }
6014 // Lookup in the initial Object.prototype object. 6018 // Lookup in the initial Object.prototype object.
6015 Handle<Object> result; 6019 Handle<Object> result;
6016 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( 6020 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
6017 isolate, result, 6021 isolate, result,
6018 Object::GetProperty(isolate->initial_object_prototype(), 6022 Object::GetProperty(isolate->initial_object_prototype(),
6019 Handle<Symbol>::cast(raw_key))); 6023 Handle<Symbol>::cast(raw_key)));
6020 return *result; 6024 return *result;
6021 } 6025 }
6022 6026
6023 // Convert the key to a string. 6027 // Convert the key to a string.
(...skipping 9622 matching lines...) Expand 10 before | Expand all | Expand 10 after
15646 } 15650 }
15647 return NULL; 15651 return NULL;
15648 } 15652 }
15649 15653
15650 15654
15651 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { 15655 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) {
15652 return &(kIntrinsicFunctions[static_cast<int>(id)]); 15656 return &(kIntrinsicFunctions[static_cast<int>(id)]);
15653 } 15657 }
15654 15658
15655 } } // namespace v8::internal 15659 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/contexts.h ('k') | test/mjsunit/es6/arguments-iterator.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698