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

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: Added more thorough test for own property descriptor 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 5946 matching lines...) Expand 10 before | Expand all | Expand 10 after
5957 5957
5958 // Try to convert the key to an index. If successful and within 5958 // Try to convert the key to an index. If successful and within
5959 // index return the the argument from the frame. 5959 // index return the the argument from the frame.
5960 uint32_t index; 5960 uint32_t index;
5961 if (raw_key->ToArrayIndex(&index) && index < n) { 5961 if (raw_key->ToArrayIndex(&index) && index < n) {
5962 return frame->GetParameter(index); 5962 return frame->GetParameter(index);
5963 } 5963 }
5964 5964
5965 HandleScope scope(isolate); 5965 HandleScope scope(isolate);
5966 if (raw_key->IsSymbol()) { 5966 if (raw_key->IsSymbol()) {
5967 Handle<Symbol> symbol = Handle<Symbol>::cast(raw_key);
5968 if (symbol->Equals(isolate->native_context()->iterator_symbol())) {
5969 return isolate->native_context()->array_values_iterator();
5970 }
5967 // Lookup in the initial Object.prototype object. 5971 // Lookup in the initial Object.prototype object.
5968 Handle<Object> result; 5972 Handle<Object> result;
5969 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( 5973 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
5970 isolate, result, 5974 isolate, result,
5971 Object::GetProperty(isolate->initial_object_prototype(), 5975 Object::GetProperty(isolate->initial_object_prototype(),
5972 Handle<Symbol>::cast(raw_key))); 5976 Handle<Symbol>::cast(raw_key)));
5973 return *result; 5977 return *result;
5974 } 5978 }
5975 5979
5976 // Convert the key to a string. 5980 // Convert the key to a string.
(...skipping 9642 matching lines...) Expand 10 before | Expand all | Expand 10 after
15619 } 15623 }
15620 return NULL; 15624 return NULL;
15621 } 15625 }
15622 15626
15623 15627
15624 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { 15628 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) {
15625 return &(kIntrinsicFunctions[static_cast<int>(id)]); 15629 return &(kIntrinsicFunctions[static_cast<int>(id)]);
15626 } 15630 }
15627 15631
15628 } } // namespace v8::internal 15632 } } // 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