| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 5334433 commit 75b8d7a
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -39,20 +39,22 @@ void CreateAsyncResource(const FunctionCallbackInfo<Value>& args) { | |||
| 39 | 39 | r = new AsyncResource(isolate, args[0].As<Object>(), "foobär"); | |
| 40 | 40 | } | |
| 41 | 41 | ||
| 42 | - args.GetReturnValue().Set( | ||
| 43 | - External::New(isolate, static_cast<void*>(r))); | ||
| 42 | + args.GetReturnValue().Set(External::New( | ||
| 43 | + isolate, static_cast<void*>(r), v8::kExternalPointerTypeTagDefault)); | ||
| 44 | 44 | } | |
| 45 | 45 | ||
| 46 | 46 | void DestroyAsyncResource(const FunctionCallbackInfo<Value>& args) { | |
| 47 | 47 | assert(args[0]->IsExternal()); | |
| 48 | - auto r = static_cast<AsyncResource*>(args[0].As<External>()->Value()); | ||
| 48 | + auto r = static_cast<AsyncResource*>( | ||
| 49 | + args[0].As<External>()->Value(v8::kExternalPointerTypeTagDefault)); | ||
| 49 | 50 | delete r; | |
| 50 | 51 | } | |
| 51 | 52 | ||
| 52 | 53 | void CallViaFunction(const FunctionCallbackInfo<Value>& args) { | |
| 53 | 54 | Isolate* isolate = args.GetIsolate(); | |
| 54 | 55 | assert(args[0]->IsExternal()); | |
| 55 | - auto r = static_cast<AsyncResource*>(args[0].As<External>()->Value()); | ||
| 56 | + auto r = static_cast<AsyncResource*>( | ||
| 57 | + args[0].As<External>()->Value(v8::kExternalPointerTypeTagDefault)); | ||
| 56 | 58 | ||
| 57 | 59 | Local<String> name = | |
| 58 | 60 | String::NewFromUtf8(isolate, "methöd").ToLocalChecked(); | |
@@ -69,7 +71,8 @@ void CallViaFunction(const FunctionCallbackInfo<Value>& args) { | |||
| 69 | 71 | void CallViaString(const FunctionCallbackInfo<Value>& args) { | |
| 70 | 72 | Isolate* isolate = args.GetIsolate(); | |
| 71 | 73 | assert(args[0]->IsExternal()); | |
| 72 | - auto r = static_cast<AsyncResource*>(args[0].As<External>()->Value()); | ||
| 74 | + auto r = static_cast<AsyncResource*>( | ||
| 75 | + args[0].As<External>()->Value(v8::kExternalPointerTypeTagDefault)); | ||
| 73 | 76 | ||
| 74 | 77 | Local<String> name = | |
| 75 | 78 | String::NewFromUtf8(isolate, "methöd").ToLocalChecked(); | |
@@ -82,7 +85,8 @@ void CallViaString(const FunctionCallbackInfo<Value>& args) { | |||
| 82 | 85 | void CallViaUtf8Name(const FunctionCallbackInfo<Value>& args) { | |
| 83 | 86 | Isolate* isolate = args.GetIsolate(); | |
| 84 | 87 | assert(args[0]->IsExternal()); | |
| 85 | - auto r = static_cast<AsyncResource*>(args[0].As<External>()->Value()); | ||
| 88 | + auto r = static_cast<AsyncResource*>( | ||
| 89 | + args[0].As<External>()->Value(v8::kExternalPointerTypeTagDefault)); | ||
| 86 | 90 | ||
| 87 | 91 | Local<Value> arg = Integer::New(isolate, 42); | |
| 88 | 92 | MaybeLocal<Value> ret = r->MakeCallback("methöd", 1, &arg); | |
@@ -91,19 +95,22 @@ void CallViaUtf8Name(const FunctionCallbackInfo<Value>& args) { | |||
| 91 | 95 | ||
| 92 | 96 | void GetAsyncId(const FunctionCallbackInfo<Value>& args) { | |
| 93 | 97 | assert(args[0]->IsExternal()); | |
| 94 | - auto r = static_cast<AsyncResource*>(args[0].As<External>()->Value()); | ||
| 98 | + auto r = static_cast<AsyncResource*>( | ||
| 99 | + args[0].As<External>()->Value(v8::kExternalPointerTypeTagDefault)); | ||
| 95 | 100 | args.GetReturnValue().Set(r->get_async_id()); | |
| 96 | 101 | } | |
| 97 | 102 | ||
| 98 | 103 | void GetTriggerAsyncId(const FunctionCallbackInfo<Value>& args) { | |
| 99 | 104 | assert(args[0]->IsExternal()); | |
| 100 | - auto r = static_cast<AsyncResource*>(args[0].As<External>()->Value()); | ||
| 105 | + auto r = static_cast<AsyncResource*>( | ||
| 106 | + args[0].As<External>()->Value(v8::kExternalPointerTypeTagDefault)); | ||
| 101 | 107 | args.GetReturnValue().Set(r->get_trigger_async_id()); | |
| 102 | 108 | } | |
| 103 | 109 | ||
| 104 | 110 | void GetResource(const FunctionCallbackInfo<Value>& args) { | |
| 105 | 111 | assert(args[0]->IsExternal()); | |
| 106 | - auto r = static_cast<AsyncResource*>(args[0].As<External>()->Value()); | ||
| 112 | + auto r = static_cast<AsyncResource*>( | ||
| 113 | + args[0].As<External>()->Value(v8::kExternalPointerTypeTagDefault)); | ||
| 107 | 114 | args.GetReturnValue().Set(r->get_resource()); | |
| 108 | 115 | } | |
| 109 | 116 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments