MCPcopy Index your code
hub / github.com/nodejs/node-addon-api / Iterator

Method Iterator

test/objectwrap.cc:92–100  ·  view source on GitHub ↗

creates dummy array, returns `([value])[Symbol.iterator]()`

Source from the content-addressed store, hash-verified

90
91 // creates dummy array, returns `([value])[Symbol.iterator]()`
92 Napi::Value Iterator(const Napi::CallbackInfo& info) {
93 Napi::Array array = Napi::Array::New(info.Env());
94 array.Set(array.Length(), Napi::String::From(info.Env(), value_));
95 return MaybeUnwrap(
96 MaybeUnwrap(array.Get(MaybeUnwrap(
97 Napi::Symbol::WellKnown(info.Env(), "iterator"))))
98 .As<Napi::Function>()
99 .Call(array, {}));
100 }
101
102 void TestVoidMethodT(const Napi::CallbackInfo& info) {
103 value_ = MaybeUnwrap(info[0].ToString());

Callers

nothing calls this directly

Calls 6

MaybeUnwrapFunction · 0.85
EnvMethod · 0.80
SetMethod · 0.80
LengthMethod · 0.80
CallMethod · 0.80
GetMethod · 0.80

Tested by

no test coverage detected