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

Side by Side Diff: src/api.cc

Issue 17781002: Allow users of the V8 API to distinguish between unset and undefined HiddenValues (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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
« no previous file with comments | « no previous file | src/objects.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 3917 matching lines...) Expand 10 before | Expand all | Expand 10 after
3928 v8::Local<v8::Value> v8::Object::GetHiddenValue(v8::Handle<v8::String> key) { 3928 v8::Local<v8::Value> v8::Object::GetHiddenValue(v8::Handle<v8::String> key) {
3929 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); 3929 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
3930 ON_BAILOUT(isolate, "v8::Object::GetHiddenValue()", 3930 ON_BAILOUT(isolate, "v8::Object::GetHiddenValue()",
3931 return Local<v8::Value>()); 3931 return Local<v8::Value>());
3932 ENTER_V8(isolate); 3932 ENTER_V8(isolate);
3933 i::Handle<i::JSObject> self = Utils::OpenHandle(this); 3933 i::Handle<i::JSObject> self = Utils::OpenHandle(this);
3934 i::Handle<i::String> key_obj = Utils::OpenHandle(*key); 3934 i::Handle<i::String> key_obj = Utils::OpenHandle(*key);
3935 i::Handle<i::String> key_string = 3935 i::Handle<i::String> key_string =
3936 isolate->factory()->InternalizeString(key_obj); 3936 isolate->factory()->InternalizeString(key_obj);
3937 i::Handle<i::Object> result(self->GetHiddenProperty(*key_string), isolate); 3937 i::Handle<i::Object> result(self->GetHiddenProperty(*key_string), isolate);
3938 if (result->IsUndefined()) return v8::Local<v8::Value>(); 3938 if (result->IsTheHole()) return v8::Local<v8::Value>();
3939 return Utils::ToLocal(result); 3939 return Utils::ToLocal(result);
3940 } 3940 }
3941 3941
3942 3942
3943 bool v8::Object::DeleteHiddenValue(v8::Handle<v8::String> key) { 3943 bool v8::Object::DeleteHiddenValue(v8::Handle<v8::String> key) {
3944 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); 3944 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
3945 ON_BAILOUT(isolate, "v8::DeleteHiddenValue()", return false); 3945 ON_BAILOUT(isolate, "v8::DeleteHiddenValue()", return false);
3946 ENTER_V8(isolate); 3946 ENTER_V8(isolate);
3947 i::HandleScope scope(isolate); 3947 i::HandleScope scope(isolate);
3948 i::Handle<i::JSObject> self = Utils::OpenHandle(this); 3948 i::Handle<i::JSObject> self = Utils::OpenHandle(this);
(...skipping 4042 matching lines...) Expand 10 before | Expand all | Expand 10 after
7991 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 7991 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
7992 Address callback_address = 7992 Address callback_address =
7993 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 7993 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
7994 VMState<EXTERNAL> state(isolate); 7994 VMState<EXTERNAL> state(isolate);
7995 ExternalCallbackScope call_scope(isolate, callback_address); 7995 ExternalCallbackScope call_scope(isolate, callback_address);
7996 return callback(info); 7996 return callback(info);
7997 } 7997 }
7998 7998
7999 7999
8000 } } // namespace v8::internal 8000 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698