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

Side by Side Diff: src/api.cc

Issue 2085223002: Add HasOwnProperty with array indexes (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 4 years, 6 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 | « include/v8.h ('k') | 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 // 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 "src/api.h" 5 #include "src/api.h"
6 6
7 #include <string.h> // For memcpy, strlen. 7 #include <string.h> // For memcpy, strlen.
8 #ifdef V8_USE_ADDRESS_SANITIZER 8 #ifdef V8_USE_ADDRESS_SANITIZER
9 #include <sanitizer/asan_interface.h> 9 #include <sanitizer/asan_interface.h>
10 #endif // V8_USE_ADDRESS_SANITIZER 10 #endif // V8_USE_ADDRESS_SANITIZER
(...skipping 4167 matching lines...) Expand 10 before | Expand all | Expand 10 after
4178 Local<Name> key) { 4178 Local<Name> key) {
4179 PREPARE_FOR_EXECUTION_PRIMITIVE(context, Object, HasOwnProperty, bool); 4179 PREPARE_FOR_EXECUTION_PRIMITIVE(context, Object, HasOwnProperty, bool);
4180 auto self = Utils::OpenHandle(this); 4180 auto self = Utils::OpenHandle(this);
4181 auto key_val = Utils::OpenHandle(*key); 4181 auto key_val = Utils::OpenHandle(*key);
4182 auto result = i::JSReceiver::HasOwnProperty(self, key_val); 4182 auto result = i::JSReceiver::HasOwnProperty(self, key_val);
4183 has_pending_exception = result.IsNothing(); 4183 has_pending_exception = result.IsNothing();
4184 RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool); 4184 RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool);
4185 return result; 4185 return result;
4186 } 4186 }
4187 4187
4188 Maybe<bool> v8::Object::HasOwnProperty(Local<Context> context, uint32_t index) {
4189 PREPARE_FOR_EXECUTION_PRIMITIVE(context, Object, HasOwnProperty, bool);
4190 auto self = Utils::OpenHandle(this);
4191 auto result = i::JSReceiver::HasOwnProperty(self, index);
4192 has_pending_exception = result.IsNothing();
4193 RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool);
4194 return result;
4195 }
4188 4196
4189 bool v8::Object::HasOwnProperty(Local<String> key) { 4197 bool v8::Object::HasOwnProperty(Local<String> key) {
4190 auto context = ContextFromHeapObject(Utils::OpenHandle(this)); 4198 auto context = ContextFromHeapObject(Utils::OpenHandle(this));
4191 return HasOwnProperty(context, key).FromMaybe(false); 4199 return HasOwnProperty(context, key).FromMaybe(false);
4192 } 4200 }
4193 4201
4194 4202
4195 Maybe<bool> v8::Object::HasRealNamedProperty(Local<Context> context, 4203 Maybe<bool> v8::Object::HasRealNamedProperty(Local<Context> context,
4196 Local<Name> key) { 4204 Local<Name> key) {
4197 PREPARE_FOR_EXECUTION_PRIMITIVE(context, Object, HasRealNamedProperty, bool); 4205 PREPARE_FOR_EXECUTION_PRIMITIVE(context, Object, HasRealNamedProperty, bool);
(...skipping 4680 matching lines...) Expand 10 before | Expand all | Expand 10 after
8878 Address callback_address = 8886 Address callback_address =
8879 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 8887 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
8880 VMState<EXTERNAL> state(isolate); 8888 VMState<EXTERNAL> state(isolate);
8881 ExternalCallbackScope call_scope(isolate, callback_address); 8889 ExternalCallbackScope call_scope(isolate, callback_address);
8882 callback(info); 8890 callback(info);
8883 } 8891 }
8884 8892
8885 8893
8886 } // namespace internal 8894 } // namespace internal
8887 } // namespace v8 8895 } // namespace v8
OLDNEW
« no previous file with comments | « include/v8.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698