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

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: Fix arguments object as prototype 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
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 5974 matching lines...) Expand 10 before | Expand all | Expand 10 after
5985 5985
5986 // Try to convert the key to an index. If successful and within 5986 // Try to convert the key to an index. If successful and within
5987 // index return the the argument from the frame. 5987 // index return the the argument from the frame.
5988 uint32_t index; 5988 uint32_t index;
5989 if (raw_key->ToArrayIndex(&index) && index < n) { 5989 if (raw_key->ToArrayIndex(&index) && index < n) {
5990 return frame->GetParameter(index); 5990 return frame->GetParameter(index);
5991 } 5991 }
5992 5992
5993 HandleScope scope(isolate); 5993 HandleScope scope(isolate);
5994 if (raw_key->IsSymbol()) { 5994 if (raw_key->IsSymbol()) {
5995 Handle<Symbol> symbol = Handle<Symbol>::cast(raw_key);
5996 if (symbol->Equals(isolate->native_context()->iterator_symbol())) {
5997 return isolate->native_context()->array_values_iterator();
5998 }
5995 // Lookup in the initial Object.prototype object. 5999 // Lookup in the initial Object.prototype object.
5996 Handle<Object> result; 6000 Handle<Object> result;
5997 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( 6001 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
5998 isolate, result, 6002 isolate, result,
5999 Object::GetProperty(isolate->initial_object_prototype(), 6003 Object::GetProperty(isolate->initial_object_prototype(),
6000 Handle<Symbol>::cast(raw_key))); 6004 Handle<Symbol>::cast(raw_key)));
6001 return *result; 6005 return *result;
6002 } 6006 }
6003 6007
6004 // Convert the key to a string. 6008 // Convert the key to a string.
(...skipping 9619 matching lines...) Expand 10 before | Expand all | Expand 10 after
15624 } 15628 }
15625 return NULL; 15629 return NULL;
15626 } 15630 }
15627 15631
15628 15632
15629 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { 15633 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) {
15630 return &(kIntrinsicFunctions[static_cast<int>(id)]); 15634 return &(kIntrinsicFunctions[static_cast<int>(id)]);
15631 } 15635 }
15632 15636
15633 } } // namespace v8::internal 15637 } } // namespace v8::internal
OLDNEW
« src/accessors.cc ('K') | « 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