►
From YouTube: Node.js N-API Team meeting - Jan 27 2020
Description
A
A
B
B
C
C
I'm
just
thinking
thinking
about
this
draining
thing
so
so
then
the
okay,
so
to
drain
the
queue.
Okay,
I
guess:
I,
guess
that
would
have
to
be
done
in
during
release,
because
you
can't
drain
the
queue
and
then
not
release,
because
because
then
you're
not
really,
you
have
no
guarantees
that
nobody's
going
to
push
to
the
queues.
B
C
Okay,
okay,
yeah,
that's
that's
fair
I!
Guess,
I'm
wondering
if
we
were
to
modify
nappy
release
thread-safe
function
with
the
board,
to
do
that
then.
Would
that
be
exempt
or
major
or
not?
So
that's
that
it
might
fit
inside
the
the
abort
definition.
So
that's
something
that's
something
we
should
be
looking
at
is
that
work
is.
A
C
B
C
C
C
C
B
C
The
time
the
function
returns
it
has
to
be
waiting
because
behind
the
scenes
it
is
asynchronous
right
so
especially
in
a
secondary
thread
right
like
if
you,
if
you
are
bored
from
a
secondary
thread
right,
then
then
it
comes
back.
It
says
closing
right,
but
then
you
are
you'd
have
to
wait
for
four,
for
the
queue
to
drain.
You'd
have
to
wait
for
the
UV
async
send
to
complete
the
portion
of
the
of
the
code
on
the
on
the
main
thread
right.
B
A
C
That's
right,
yeah
that
would
be
yeah
that
would
be
blocking
so
so
I
mean
you
know.
If
you
create
lots
of
thread,
safe
functions
and
and
and
an
abort
them
in
in
a
tight
loop,
then
yes,
it's
gonna,
kill
the
JavaScript
thread
and
the
event
took
on
everything,
so
so
the
so
so
the
functionality
of
this
would
definitely
be
restricted
to
to
just
to
just
like
you
know,
using
one
thread
safe
function
and
then,
when
the
application
shuts
down,
you
close
it
or
you
abort
it
or
whatever,
and-
and
you
do
it
at
once,
right.
B
B
A
B
It's
just
complicated
that
can
be
possible
yeah.
C
Okay,
so
yeah
I'd
have
to
look
at
it
in
more
detail
to
descend
because
I
another
solution
might
be
to
just
have
a
just
having
a
separate
API.
You
know
like
nappy
drain
and
release
threats,
a
frog
or
a
drain,
and
a
board
thread
safe
function
or
something
like
that
and
then
and
then
that
would
be
a
separate
API
which
we'll
see
if
it
does
most
the
same
things
as
released,
and
we
might
just
roll
it
in
to
release.
C
D
C
B
B
A
B
A
A
E
A
C
B
C
C
Okay,
okay,
okay,
yeah
I,
yeah
I.
Look
at
this
issue
because
I
I
did
some
of
that
with
with
Anna,
and
this
is
this
cleanup
because
we
did.
We
did
this
so
that
so
that
when
the
when
the
object
rep
constructor
throws,
then
the
destructor
I
might
remove
the
wrap,
but
apparently
there's
still
a
double
three
at
some
point,
so
so
yeah
I'll.
Look
at
that.
Let
me
see
me
open
that
one
668.
C
C
Yeah,
so
so
so
yeah,
so
this
discussion
is
basically
stalled
for
now
we
were.
We
were
thinking
about
about
how
to
like
how
to
how
to
properly
do
context-aware,
add-ons
and
I.
Think
rotamer
months
asked
this
earlier
too.
So
I
was
thinking
about
writing
like
an
add-on
class
that
that
is
like
that
basically
represents
an
instance
of
an
add-on
running
in
a
certain
context
or
thread,
and
but
but
to
do
that
we
need.
C
We
need
to
have
the
instance
data
work
back
ported
to
ten,
so
that
we
can
run
this
on
all
versions,
because
otherwise
I
could
do
it
without
the
instance
data,
but
it
would
be
extremely
inconvenient
because
you
would
have
to
basically
thread
the
the
instance,
which
is
the
instance
of
the
add-on
class.
You'd,
have
to
thread
that
through
all
the
bindings
and
stuff
like
that
which
which
we
could
do
and
which
would
actually
work.
C
Okay,
now
that
we
have
this,
this
deleting
of
the
references
at
at
environment
shut
down,
now
that
we
have
that
this
would
actually
work,
but
it
would
be
a
lot
easier
to
do
with,
with,
with
with
the
instance
data
because
oh
and
he
would
have
performance
implications,
not
to
do
it
right
instance.
Data,
because
you
know
in
every
binding
will
now
have
to
call
nappy,
gets
being
full,
whether
whether
or
not
that's
needed
right
so.
A
C
C
B
C
A
A
C
B
C
We
have
a
few
things
we
have
like
you,
have
the
array,
buffer
detach
and
is
detached
right,
and
we
have
the
instance,
data
and
I
think
we
have
a
few
other
things
in
there.
So
so
that
would
be
an
API
six.
You
know
and
then
we
would
have
to
back
port
the
the
marking
of
that
as
stable,
and
we
don't
have
to
do
that
before
April
when
10
goes
into
maintenance
and
then,
if,
if
ideally.
C
C
B
C
D
C
A
C
A
A
F
C
A
C
C
There
are
some
there
are
some
minor
issues
like,
for
example,
for
for
for
object
right.
This
class
would
be
a
lot
like
object,
wrap
right
because
it
would.
It
would
just
be
a
an
instance
of
a
class
and
there
would
be
like
methods
on
it
right,
but
the
key
difference
would
be
that
an
object,
wrap,
there's
a
there's,
a
nice
correlation
between
the
the
method
being
static
in
C++
and
the
method
being
static
in
JavaScript.
Right
now,.
B
C
Code
that
correlation
would
have
to
break
because,
because
all
methods
would
be
instance,
instance
methods
in
in
this
class
right,
because
that's
the
point
right,
you
always
have
that
this
pointer,
where
you
store
a
store
all
your
state,
so
you
don't
have
to
worry
about.
Where
do
I
put
my
state
right?
It
would
always
be
this,
but
then,
but
then,
if
you
want
to
declare
a
class
within
your
add-on
or
or
or
an
object,
wrap
subclass
within
your
add-on.
Now
you
have
static
methods
right.
C
So
so
the
question
becomes,
you
know:
do
we
rework
object,
wrap
as
well,
so
that,
even
though
the
the
methods
are
static
on
the
JavaScript
side,
they
are
not
static
on
the
on
the
C++
side,
but
rather
they
are.
They
are
methods
of
the
add-on
class
right
so
that
so
that
static
methods
in
JavaScript
received
the
add-on
class
as
their
C++.
This
pointer
and
and
instance,
methods
on
the
JavaScript
side
receive
the
C++
instance
as
there
at
this
point
there,
as
they
do
today
right
so
so,
basically
they're
there
there
would
be.
C
That's
easy
to
do
right
so,
basically,
basically
from
from
from
the
overall
picture,
would
be
that
there
are
no
more
static
methods
on
the
C++
side
at
all.
And
what
are
the
implications
of
that?
You
know
that.
That's
that's
what
we
have
to
work
through
with
this
class,
because
you
want
everything
to
be
an
instance
method.
Otherwise
you,
you
are
not
really
avoiding.
F
F
C
C
Why
I'm
saying
that
that
the
the
the
the
static
message
would
you
know
they
would
have
to
have
access
to
do
to
the
add-on
class
instance,
meaning
that
they
wouldn't
really
be
static
anymore,
because
you
know
they
would
be
called
with
with
the
C++
this
value
set
to
the
add-on
instance,
so
they
would
so.
The
static
methods
of
the
object,
wrap
class
would
really
be
instance,
methods
of
the
add-on
class.
C
Well,
it
shouldn't
affect
performance
because
retrieving
the
retrieving.
The
instance
is
very
cheap
yep.
It
might
affect
performance
a
little
bit
because
so
far
you
know
you
know
retrieving
a
static
variable
is,
is
I
mean
it's?
It's
it's
yeah
ridiculously
cheap
right.
This
would
not
be
as
cheap
because
it
would
be
a
function
call.
You
know
across
a
across
a
dynamic
library
boundaries.
So,
yes,
it
would
be
more
expensive,
but
on
the
other
hand,
you
wouldn't
you
would
be
ready
for
for
worker
threads
yep.
B
C
C
A
C
The
there
is
a
potential
here
that
I
might
have
to
write
like
implementations
of
everything,
basically
like
function,
mu
and
all
the
property
descriptors,
and
and
all
that
you
know,
definitions
which
might
diverge
from
what
we
have
now,
because
now
they
are
all
now
they
are
all
class
methods
of
this
add-on
class
right.
So
there
is
there's
potential
that
there's
gonna
be
enormous
code,
duplication
at
least
that
at
first
until
we
figure
out
what
what
are
what
are
bits
in
common.
So
I
was
thinking.
C
Maybe
maybe
doing
this
in
like
a
separate
header
file
that
gets
included
from
from
from
nap
eh
because
it
would
just
I
would
just
be
lost.
You
know
like
okay,
if
you
descriptor
for
the
add-on
class,
or
is
this
the
property
descriptor
or
for
for
the
nappy
namespace,
so
I
think
I'll
just
do
it
that
way
for
now,
and
then
we
can,
you
can
skip
hash
that
out
as
the
pure
forces.
Okay
sounds.
A
A
B
C
A
Okay,
well,
leave
it
maybe
till
next
weekend:
okay,
yeah
I
think
we
already
talked
about
the
next
December
majors.
So
probably
that's
the
lists
there.
I
don't
know.
If
there's
anything
in
core
that
we
should
talk
about.
C
B
A
So
I
think
oh,
the.
C
D
C
C
C
B
C
C
C
C
C
B
F
C
Well,
yeah
yeah
I
mean
I,
don't
know
if
so
so.
Yes,
it's
implemented
in
v8,
but
I'm,
not
sure
if
it's
exposed
in
v8.
So
if
you,
you
know,
if
you,
if
you
say
like
you,
know
like,
if
you
set
property
on
an
object,
can
you
say
private?
You
know
because
because
you
know
you
can
say,
readable,
writable
enumerable,
alright
in
figure
above
it
now,
because
so
like
the
the
JavaScript
interface,
where
it
works,
but
does
the
native
interface
sure
yeah
I
mean
I'm.
A
C
B
C
Implement
this
right,
yeah!
Well
there!
Okay,
there
is
one
caveat
right,
so
so
in
Jerry
script
it
was
possible
to
implement
object
wrapped,
but,
unlike
v8,
JavaScript
only
gave
you
a
single
pointer
that
you
could
attach
to
an
object,
and
so
so
it
was
up
to
you
to
you,
then,
to
then
make
that
pointer,
mm-hmm
be
sort
of
a
complex
structure
which
can
accommodate
multiple
things
right.
B
C
Of
course,
the
scope
of
Jerry
script
is
much
more
restricted
than
the
scope
of
nodejs
and
and
the
chance
is
that
that
two
different
objects
or
two
different
modules
maintained
by
two
different
independent
teams
would
would
be
vying
over
the
same
object
is,
is
a
lot
less,
but
but
nevertheless
it
is
possible.
So
so
in
Jerry
script,
when
when
I
did
an
API
and
Jerry
script,
I
basically
implemented
this,
because
because
at
that
time
we
were
using
more
than
one
private
I.
Think
because
we
were
you,
we
were
doing
wrapping
differently.
B
C
So
we
needed
more
than
one
thing
to
be
stored
on
the
object,
whereas
we
only
had
one
pointer
from
Jerry
script
and
so
I
basically
wrote
the
manager
for
that
right,
but
Bret
would
not
have
worked
so
so
the
bottom
line
is
I.
Guess
the
engine
needs
to
provide
not
only
the
ability
to
attach
a
pointer
to
an
to
an
object,
but
also
the
ability
to
attach
any
number
of
pointers
to
an
object
so
so
and
so
far
we
have
restricted
ourselves
to
using
it,
for
only
one
reason.
A
A
D
C
I
think
from
the
fact
that
all
these
native
modules
they're
fronted
by
j/s
modules,
so
so,
the
the
actual
consumer
of
the
of
the
of
the
package,
which
is
you
know,
which
is
based
on
a
native
module,
doesn't
deal
with
the
native
module
and
so
objects
don't
get
into
the
native
module,
except
via
the
Jas
interface,
at
which
point
they
can
be
validated.
So
that's
that's
the
kind
of
safety
we
have
today.
If
we
added
this,
it
would
be
unequivocally
yes
or
no
right.
Is
this
object
for
real
or
not
right?.
A
So
I
get
I,
get
that
and
just
it's
the
risk/reward
right
right
yeah
is
it?
Are
we
risking
something
that,
like
you
know
in
the
future,
we'll
be
like?
Oh,
we
can't
quite
support
this
in
this
environment
or
that
and
versus
you
know.
Is
it
like.
We
really
really
that's?
Okay,
if
it's
like!
Oh,
we
really
really
need
this
right.
Well,.
C
Actually,
actually
seen
since
Nicola
mentioned
this,
this
introduction
the
private
fields
right.
If
and
when
this
lands,
then
then
we
can.
You
know
we
can
rest
assured
that
we
can
always
store
a
value
in
a
private
field,
assuming
the
the
engine
exposes
that
regular
part
of
the
spec
on
using
its
native
interface,
rather
than
its
JavaScript
interface
right.
B
C
Even
if
it
doesn't
we
can,
we
can
well
actually
who
I
don't
know,
because,
like
setting
private
fields,
you
have
to
do
that
within
the
context
of
a
class
right.
So
so
then,
so
then
setting
private
fields
would
still
be
strictly
like.
It
wouldn't
be
possible
on
just
plain
objects,
because
there
is
no
class
right
as
far
as
I.
C
A
C
C
C
Sure
I'm
not
sure
if
we
could
do
it
even
object,
wrap
right,
because,
because
you
know
the
code,
the
code
which
which
accesses
these
private
fields
has
to
be
running
within
the
context
of
the
class
right.
So
so,
basically,
the
like
on
the
JavaScript
side
that
this
pointer
would
have
to
be
would
have
to
be
an
instance
of
the
class.
All
right.
B
C
Not
just
you
know,
cuz
I
mean
you
can
set
at
this
point
or
to
whatever
you
want
right,
but
it
would.
It
would
like
the
context
not
just
at
this
pointer
but
but
the
context
would
have
to
be
of
running
inside
the
class
right.
Then,
how
do
you
run
native
code
inside
a
class
right
because
the
native
code,
when
you
the
call,
doesn't
really
the
scopes,
are
not
really
accessible
from
the
native
side
and
right
and
the
context
is
that
this
point
there?
C
C
B
B
B
And
now
another
question
come
out
in
value:
are
you
discussing
that?
Does
this
disturb
tacking
actually
differs
from?
We
attach
the
tag
tag
with
a
symbol,
since
we
could
change
quickly
change
the
tag
with
our
with
will
any
with
any
better
really
want
so
I
found
it
kinda
similar
to
touch
the.
We
have
your
ID
with
symbol.
C
B
C
It
was
using
a
symbol
right
because
before
we
had
nappy
at
finalizar,
the
only
way
to
attach
data
to
an
object
was
with
a
symbol
right
and
so
so,
as
as
a
nappy
at
finalizar
was
working
its
way
through
the
back
ports
attached
that
it
was
implemented
using
using
a
symbol
and
then
I
think
only
recently
did
I
change
it.
If
I
even
did
I
think
I
did
do
to
use
nappy
at
finalizar
everywhere
because
it
became
available.
C
B
B
C
B
C
Yes,
yes,
okay,
the
problem
is,
and
I
was
talking
to
to
Anna
about
this-
is
that
is
that
the
the
symbol,
the
symbol
would
be
lost
if
if
the
module
is
unloaded
right
so
or
it
might
be
lost
depending
on
how
we
implement
it
right,
whereas
so
so,
basically
the
the
problem
was.
If
the
module
is
unloaded
and
then
loaded
again
right,
then
then-
and
there
are-
there-
are
still
instances
of
the
old
module
left
in
scope.
C
Then
then,
then,
the
reloaded
module
should
recognize
those
instances
right
because
because
they're
still
valid
instances
from
from
the
previous
instantiation
of
the
module,
and
so
that's
why
we
went
with
the
UUID
right,
like
I.
Just
had
I
had
a
static
pointer
before
right.
So
you
know
just
use
a
pointer
to
some
static
data
and
that's
fine,
because
it's
unique
for
the
for
the
lifetime
of
the
module,
but
only
for
the
lifetime
of
the
module
right.
C
If
you
unload
the
module,
then
then
you
know
you'll,
have
you
have
a
bunch
of
instances
floating
around
the
engine
which
which
which
have
this
pointer
and
then
you
reload
the
module?
The
module
gets
loaded
elsewhere.
The
point
of
value
changes
and
now
the
new,
the
new
version
of
the
module
or
the
new
instance
of
the
module,
doesn't
recognize
the
old
instances
anymore,
even
though
it
should.
B
B
B
B
Yeah
I
mean
what,
if
the
Java
JavaScript
instance
in
enough
not
cause
differently,
since
the
native
module
implemented
into
model
implementation,
talent,
I
can
tell
expect
the
John
screw
instant
could
be,
can
be
used
across
different
nodes
before
it.
Even
though
the
instance
attentional
between
the
different
stick.
C
C
But
I
don't
know
I,
think
I
think
it
would
make
sense,
I
think,
logically
or
or
I
think
module
owners
would
expect
that
you
know
if
they
receive
an
instance
of
an
object
that
is
supposed
to
be
a
valid
object
in
their
module.
Then
it
will
work
as
a
valid
object
within
their
module
right.
So,
like
you
even
across
instances,
you
know
I
in
fairness.
Yes,
it's
it's
probably
unlikely,
because
if
you
unload
the
module
chances
are
the
whole
environment
is
going
down.
C
So
you
know
with
all
the
objects
and
everything
so
right
now
right
now.
This
would
probably
never
happen
because,
because
you
know
the
when
the
when
the
module
is
unloaded,
the
only
time
the
module
is
unloaded
is
when
the
worker
thread
exits
and
then
all
the
objects
are
becoming
invalid
anyway,
but
that's
not
necessarily
how
it's
always
gonna
be
right,
so
you
have
to
think
about
you
know:
modules
go
in
and
out
of
existence,
perhaps
repeatedly
and
and
their
objects
have
a
separate
life
cycle
from
from
the
from
the
module
that
produced
them.
C
There
doesn't
have
to
be
if
we
used
if
we
use
the
the
UUID
right,
because
when
when,
when
the
new
instance
of
the
module
comes
back,
you
know
it's
still
the
you
you
IDs
that
get
compared
and
the
to
you
I,
the
to
you,
you
IDs
are
the
same.
Therefore,
the
object
is
therefore
nappy.
Get
type
tag
returns
true
or
is
of
type
or
whatever
I
called
the
API.
It
returns.
C
True
and
you
know
the
pointer
gets
cast
and
it
gets
cast
correctly,
even
though
the
pointer
was
was
allocated
by
the
previous
instance
of
the
module
it
still
gets
cast
correctly,
and
then
the
data
presumably
still
valid
there,
and
so
it
won't
set
fault
right,
even
though
the
object
was
created
by
the
previous
instance
of
the
module
I
mean.
That's,
that's
the
that's
the
that's
sort
of
the
hypothesis
here,
but
we
cannot
test
it
because
there
is
no
way
to
unload
the
module
currently
I.
A
C
C
A
C
Why
do
you
do
that?
Okay,
whatever
okay,
so
burn
down?
Okay,
so
this
was
okay,
I,
guess,
I!
Guess
we're
pretty
much
done
right
because
we're
we're
out
of
time
anyway.
So
there's
not
much
else
that
we
need
to
talk
about.
Is
there
anything
else
that
we
should
be
talking
about
anybody
in
the
last
few
minutes,
I.
C
E
E
E
C
C
E
F
C
C
Okay,
okay,
I,
don't
know,
I
I
haven't
really
had
a
chance
to
look
at
this
in
detail.
I,
don't
know
about
any
of
you.
What
we're
talking
about
it?
Oh
okay,
okay,
okay,
I
see
yeah.
So
this
is.
This
is
sort
of
automated
validation,
yeah
I,
don't
know
what
do
y'all
think
I'm
thinking
this
this
would.
This
would
go
well
with
like
a
would
like
an
external
library.
C
C
F
C
C
C
C
C
C
Will
do
oh,
thank
you,
okay,
so
then
there
was
that
and
I.
Think
no
is
there
any
major
ones?
Oh
these
ones
were
over.
It.
Has
anyone
seen
any
any
more
news
on
notes
ass
because
that's
that's
a
big
one
that
might
be
ported
to
an
API
and
now
that
v8
is
off
the
table,
I
kind
of
looked
at
it
and
I
think
they're
still
maintaining
the
an
API
port,
but
I
don't
have
any
use
on
that.
So
I
don't
know.
That's
that's
I!
Guess
that's
something!