Lines Matching defs:args
53 const FunctionCallbackInfo<Value>& args) {
54 Environment* env = Environment::GetCurrent(args);
57 CHECK(args[0]->IsObject());
58 CHECK(args[1]->IsUint32());
60 Local<Object> object = args[0].As<Object>();
65 static_cast<PropertyFilter>(args[1].As<Uint32>()->Value());
74 args.GetReturnValue().Set(properties);
78 const FunctionCallbackInfo<Value>& args) {
79 CHECK(args[0]->IsObject());
81 Local<Object> object = args[0].As<Object>();
84 args.GetReturnValue().Set(name);
88 const FunctionCallbackInfo<Value>& args) {
89 CHECK(args[0]->IsExternal());
90 Isolate* isolate = args.GetIsolate();
91 Local<External> external = args[0].As<External>();
96 args.GetReturnValue().Set(ret);
99 static void GetPromiseDetails(const FunctionCallbackInfo<Value>& args) {
101 if (!args[0]->IsPromise())
104 auto isolate = args.GetIsolate();
106 Local<Promise> promise = args[0].As<Promise>();
114 args.GetReturnValue().Set(ret);
117 static void GetProxyDetails(const FunctionCallbackInfo<Value>& args) {
119 if (!args[0]->IsProxy())
122 Local<Proxy> proxy = args[0].As<Proxy>();
127 if (args.Length() == 1 || args[1]->IsTrue()) {
133 args.GetReturnValue().Set(
134 Array::New(args.GetIsolate(), ret, arraysize(ret)));
138 args.GetReturnValue().Set(ret);
142 static void GetCallerLocation(const FunctionCallbackInfo<Value>& args) {
143 Isolate* isolate = args.GetIsolate();
157 args.GetReturnValue().Set(Array::New(args.GetIsolate(), ret, arraysize(ret)));
160 static void IsArrayBufferDetached(const FunctionCallbackInfo<Value>& args) {
161 if (args[0]->IsArrayBuffer()) {
162 auto buffer = args[0].As<v8::ArrayBuffer>();
163 args.GetReturnValue().Set(buffer->WasDetached());
166 args.GetReturnValue().Set(false);
169 static void PreviewEntries(const FunctionCallbackInfo<Value>& args) {
170 if (!args[0]->IsObject())
173 Environment* env = Environment::GetCurrent(args);
176 if (!args[0].As<Object>()->PreviewEntries(&is_key_value).ToLocal(&entries))
179 if (args.Length() == 1)
180 return args.GetReturnValue().Set(entries);
186 return args.GetReturnValue().Set(
190 static void Sleep(const FunctionCallbackInfo<Value>& args) {
191 CHECK(args[0]->IsUint32());
192 uint32_t msec = args[0].As<Uint32>()->Value();
196 void ArrayBufferViewHasBuffer(const FunctionCallbackInfo<Value>& args) {
197 CHECK(args[0]->IsArrayBufferView());
198 args.GetReturnValue().Set(args[0].As<ArrayBufferView>()->HasBuffer());
271 void WeakReference::New(const FunctionCallbackInfo<Value>& args) {
272 Realm* realm = Realm::GetCurrent(args);
273 CHECK(args.IsConstructCall());
274 CHECK(args[0]->IsObject());
275 new WeakReference(realm, args.This(), args[0].As<Object>());
278 void WeakReference::Get(const FunctionCallbackInfo<Value>& args) {
279 WeakReference* weak_ref = Unwrap<WeakReference>(args.Holder());
280 Isolate* isolate = args.GetIsolate();
282 args.GetReturnValue().Set(weak_ref->target_.Get(isolate));
285 void WeakReference::IncRef(const FunctionCallbackInfo<Value>& args) {
286 WeakReference* weak_ref = Unwrap<WeakReference>(args.Holder());
290 args.GetReturnValue().Set(
291 v8::Number::New(args.GetIsolate(), weak_ref->reference_count_));
294 void WeakReference::DecRef(const FunctionCallbackInfo<Value>& args) {
295 WeakReference* weak_ref = Unwrap<WeakReference>(args.Holder());
300 args.GetReturnValue().Set(
301 v8::Number::New(args.GetIsolate(), weak_ref->reference_count_));
304 static void GuessHandleType(const FunctionCallbackInfo<Value>& args) {
305 Environment* env = Environment::GetCurrent(args);
307 if (!args[0]->Int32Value(env->context()).To(&fd)) return;
336 args.GetReturnValue().Set(OneByteString(env->isolate(), type));
339 static void ToUSVString(const FunctionCallbackInfo<Value>& args) {
340 Environment* env = Environment::GetCurrent(args);
341 CHECK_GE(args.Length(), 2);
342 CHECK(args[0]->IsString());
343 CHECK(args[1]->IsNumber());
345 TwoByteValue value(env->isolate(), args[0]);
347 int64_t start = args[1]->IntegerValue(env->context()).FromJust();
366 args.GetReturnValue().Set(