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

Side by Side Diff: src/api.cc

Issue 7321006: Add GetPropertyAttribute method for Object in the API (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add proper exception handling Created 9 years, 5 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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 2687 matching lines...) Expand 10 before | Expand all | Expand 10 after
2698 ENTER_V8(isolate); 2698 ENTER_V8(isolate);
2699 i::Handle<i::JSObject> self = Utils::OpenHandle(this); 2699 i::Handle<i::JSObject> self = Utils::OpenHandle(this);
2700 EXCEPTION_PREAMBLE(isolate); 2700 EXCEPTION_PREAMBLE(isolate);
2701 i::Handle<i::Object> result = i::GetElement(self, index); 2701 i::Handle<i::Object> result = i::GetElement(self, index);
2702 has_pending_exception = result.is_null(); 2702 has_pending_exception = result.is_null();
2703 EXCEPTION_BAILOUT_CHECK(isolate, Local<Value>()); 2703 EXCEPTION_BAILOUT_CHECK(isolate, Local<Value>());
2704 return Utils::ToLocal(result); 2704 return Utils::ToLocal(result);
2705 } 2705 }
2706 2706
2707 2707
2708 PropertyAttribute v8::Object::GetPropertyAttribute(v8::Handle<Value> key) {
2709 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
2710 ON_BAILOUT(isolate, "v8::Object::GetPropertyAttribute()",
2711 return static_cast<PropertyAttribute>(NONE));
2712 ENTER_V8(isolate);
2713 i::Handle<i::JSObject> self = Utils::OpenHandle(this);
2714 i::Handle<i::Object> key_obj = Utils::OpenHandle(*key);
2715 EXCEPTION_PREAMBLE(isolate);
2716 PropertyAttributes result =
2717 self->TryGetPropertyAttribute(key_obj, &has_pending_exception);
Mads Ager (chromium) 2011/07/15 07:25:51 Could you put this one in handles.[h,cc] as is don
2718 EXCEPTION_BAILOUT_CHECK(isolate, static_cast<PropertyAttribute>(NONE));
2719 return static_cast<PropertyAttribute>(result);
2720 }
2721
2722
2708 Local<Value> v8::Object::GetPrototype() { 2723 Local<Value> v8::Object::GetPrototype() {
2709 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); 2724 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
2710 ON_BAILOUT(isolate, "v8::Object::GetPrototype()", 2725 ON_BAILOUT(isolate, "v8::Object::GetPrototype()",
2711 return Local<v8::Value>()); 2726 return Local<v8::Value>());
2712 ENTER_V8(isolate); 2727 ENTER_V8(isolate);
2713 i::Handle<i::Object> self = Utils::OpenHandle(this); 2728 i::Handle<i::Object> self = Utils::OpenHandle(this);
2714 i::Handle<i::Object> result = i::GetPrototype(self); 2729 i::Handle<i::Object> result = i::GetPrototype(self);
2715 return Utils::ToLocal(result); 2730 return Utils::ToLocal(result);
2716 } 2731 }
2717 2732
(...skipping 3166 matching lines...) Expand 10 before | Expand all | Expand 10 after
5884 5899
5885 5900
5886 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { 5901 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) {
5887 HandleScopeImplementer* scope_implementer = 5902 HandleScopeImplementer* scope_implementer =
5888 reinterpret_cast<HandleScopeImplementer*>(storage); 5903 reinterpret_cast<HandleScopeImplementer*>(storage);
5889 scope_implementer->IterateThis(v); 5904 scope_implementer->IterateThis(v);
5890 return storage + ArchiveSpacePerThread(); 5905 return storage + ArchiveSpacePerThread();
5891 } 5906 }
5892 5907
5893 } } // namespace v8::internal 5908 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698