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

Side by Side Diff: src/api.cc

Issue 201114: Implemented Object.keys. (Closed)
Patch Set: try-again Created 11 years, 3 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
« no previous file with comments | « LICENSE ('k') | src/handles.h » ('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 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 1970 matching lines...) Expand 10 before | Expand all | Expand 10 after
1981 } 1981 }
1982 return Utils::ToLocal(i::Handle<i::JSObject>(object)); 1982 return Utils::ToLocal(i::Handle<i::JSObject>(object));
1983 } 1983 }
1984 1984
1985 1985
1986 Local<Array> v8::Object::GetPropertyNames() { 1986 Local<Array> v8::Object::GetPropertyNames() {
1987 ON_BAILOUT("v8::Object::GetPropertyNames()", return Local<v8::Array>()); 1987 ON_BAILOUT("v8::Object::GetPropertyNames()", return Local<v8::Array>());
1988 ENTER_V8; 1988 ENTER_V8;
1989 v8::HandleScope scope; 1989 v8::HandleScope scope;
1990 i::Handle<i::JSObject> self = Utils::OpenHandle(this); 1990 i::Handle<i::JSObject> self = Utils::OpenHandle(this);
1991 i::Handle<i::FixedArray> value = i::GetKeysInFixedArrayFor(self); 1991 i::Handle<i::FixedArray> value = i::GetKeysInFixedArrayFor(
1992 self,
1993 i::INCLUDE_PROTOS);
1992 // Because we use caching to speed up enumeration it is important 1994 // Because we use caching to speed up enumeration it is important
1993 // to never change the result of the basic enumeration function so 1995 // to never change the result of the basic enumeration function so
1994 // we clone the result. 1996 // we clone the result.
1995 i::Handle<i::FixedArray> elms = i::Factory::CopyFixedArray(value); 1997 i::Handle<i::FixedArray> elms = i::Factory::CopyFixedArray(value);
1996 i::Handle<i::JSArray> result = i::Factory::NewJSArrayWithElements(elms); 1998 i::Handle<i::JSArray> result = i::Factory::NewJSArrayWithElements(elms);
1997 return scope.Close(Utils::ToLocal(result)); 1999 return scope.Close(Utils::ToLocal(result));
1998 } 2000 }
1999 2001
2000 2002
2001 Local<String> v8::Object::ObjectProtoToString() { 2003 Local<String> v8::Object::ObjectProtoToString() {
(...skipping 1723 matching lines...) Expand 10 before | Expand all | Expand 10 after
3725 3727
3726 3728
3727 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { 3729 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) {
3728 HandleScopeImplementer* thread_local = 3730 HandleScopeImplementer* thread_local =
3729 reinterpret_cast<HandleScopeImplementer*>(storage); 3731 reinterpret_cast<HandleScopeImplementer*>(storage);
3730 thread_local->IterateThis(v); 3732 thread_local->IterateThis(v);
3731 return storage + ArchiveSpacePerThread(); 3733 return storage + ArchiveSpacePerThread();
3732 } 3734 }
3733 3735
3734 } } // namespace v8::internal 3736 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « LICENSE ('k') | src/handles.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698