mirror of
https://github.com/nodejs/node.git
synced 2026-11-09 15:11:11 -05:00
src: update use of ExternalArrayType constants
Continuation of 4809c7a to update the use of v8::ExternalArrayType.
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
This commit is contained in:
1 parent
573e6afc09
commit
bdc2ea4d52
3 files changed
+8
-8
No files matched your search
+4
-4
@@ -120,7 +120,7 @@ using v8::TryCatch;
|
||||
using v8::Uint32;
|
||||
using v8::V8;
|
||||
using v8::Value;
|
||||
using v8::kExternalUnsignedIntArray;
|
||||
using v8::kExternalUint32Array;
|
||||
|
||||
// FIXME(bnoordhuis) Make these per-context?
|
||||
QUEUE handle_wrap_queue = { &handle_wrap_queue, &handle_wrap_queue };
|
||||
@@ -928,7 +928,7 @@ void SetupAsyncListener(const FunctionCallbackInfo<Value>& args) {
|
||||
Environment::AsyncListener* async_listener = env->async_listener();
|
||||
async_listener_flag_obj->SetIndexedPropertiesToExternalArrayData(
|
||||
async_listener->fields(),
|
||||
kExternalUnsignedIntArray,
|
||||
kExternalUint32Array,
|
||||
async_listener->fields_count());
|
||||
|
||||
// Do a little housekeeping.
|
||||
@@ -968,7 +968,7 @@ void SetupDomainUse(const FunctionCallbackInfo<Value>& args) {
|
||||
Environment::DomainFlag* domain_flag = env->domain_flag();
|
||||
domain_flag_obj->SetIndexedPropertiesToExternalArrayData(
|
||||
domain_flag->fields(),
|
||||
kExternalUnsignedIntArray,
|
||||
kExternalUint32Array,
|
||||
domain_flag->fields_count());
|
||||
|
||||
// Do a little housekeeping.
|
||||
@@ -993,7 +993,7 @@ void SetupNextTick(const FunctionCallbackInfo<Value>& args) {
|
||||
Local<Object> tick_info_obj = args[0].As<Object>();
|
||||
tick_info_obj->SetIndexedPropertiesToExternalArrayData(
|
||||
env->tick_info()->fields(),
|
||||
kExternalUnsignedIntArray,
|
||||
kExternalUint32Array,
|
||||
env->tick_info()->fields_count());
|
||||
|
||||
env->set_tick_callback_function(args[1].As<Function>());
|
||||
|
||||
+1
-1
@@ -87,7 +87,7 @@ bool HasInstance(Handle<Object> obj) {
|
||||
if (!obj->HasIndexedPropertiesInExternalArrayData())
|
||||
return false;
|
||||
v8::ExternalArrayType type = obj->GetIndexedPropertiesExternalArrayDataType();
|
||||
return type == v8::kExternalUnsignedByteArray;
|
||||
return type == v8::kExternalUint8Array;
|
||||
}
|
||||
|
||||
|
||||
|
||||
+3
-3
@@ -51,7 +51,7 @@ using v8::RetainedObjectInfo;
|
||||
using v8::Uint32;
|
||||
using v8::Value;
|
||||
using v8::WeakCallbackData;
|
||||
using v8::kExternalUnsignedByteArray;
|
||||
using v8::kExternalUint8Array;
|
||||
|
||||
|
||||
class CallbackInfo {
|
||||
@@ -304,7 +304,7 @@ void Alloc(const FunctionCallbackInfo<Value>& args) {
|
||||
|
||||
// it's faster to not pass the default argument then use Uint32Value
|
||||
if (args[2]->IsUndefined()) {
|
||||
array_type = kExternalUnsignedByteArray;
|
||||
array_type = kExternalUint8Array;
|
||||
} else {
|
||||
array_type = static_cast<ExternalArrayType>(args[2]->Uint32Value());
|
||||
size_t type_length = ExternalArraySize(array_type);
|
||||
@@ -385,7 +385,7 @@ void AllocDispose(Environment* env, Handle<Object> obj) {
|
||||
|
||||
if (data != NULL) {
|
||||
obj->SetIndexedPropertiesToExternalArrayData(NULL,
|
||||
kExternalUnsignedByteArray,
|
||||
kExternalUint8Array,
|
||||
0);
|
||||
free(data);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user