►
From YouTube: Node.js N-API Team meeting - Nov 18 2019
Description
B
B
A
B
B
A
B
B
B
B
A
A
E
A
A
A
D
F
B
Okay,
no
worries
I'll,
try
incoming.
G
A
A
H
H
So
we
had
a
discussion
last
week
during
the
call
about
purpose
of
object,
reference
and
function.
Reference
I've,
updated
the
narrative
on
that
one
kevin
has
contributed
page
for
the
thread-safe
functions
and
Kevin
have
some
questions
specifically
about
the
examples
that
should
be
included
there.
So
that
may
be
something
we
want
to
discuss
here
for
Kevin's
benefit.
Sure
so
he's
just
asking
for
help
on
what
what
sort
of
example
should
be
included
with
that.
H
A
H
H
H
D
D
H
D
A
D
D
It
depends
how
how
far
we
want
to
go
right,
because
if
the
round
trip
the
round
trip
does
require
additional
synchronization
right.
So
so
so
that's
already
sort
of
like
oh,
like
a
more
advanced
example,
I
think
we
have
a
basic
one,
which
is,
which
is
not
a
round
trip.
It's
just
calling
into
JavaScript,
but
I
I'm,
not
sure
that
might
be
better.
D
A
D
Well,
this
is
this
is
in.
This
is
actually
I
think
this
is
sort
of
this
is
sort
of
like
a
progress
worker
I.
Think.
A
E
E
D
A
D
D
A
B
D
A
H
A
H
E
E
E
H
Exactly
exactly
I
mean
it
it's
it's
pretty
far
along
it's
just
a
matter
of
you
know,
it's
gonna
be
a
matter
of
carving
out
several
days
just
to
to
focus
right.
Yes,
but
it
might
be
something
we
might
consider
putting
on
the
niccola's
list,
also
before
the
workshop
as
a
potential
port
that
people
might
want
to
get
involved
with
yeah.
E
E
We
we
have
photo
workshop
and
my
idea
is
yeah
to
to
ping
with
the
maintainer
and
if
they
are
interested
in
the
four
thing
we
can
say
these
at
at
workshop
and
yeah
if
they
won't
be
involved.
But
if
could
choose
one
of
this
project
and
do
the
work
and
started
the
work
with
our
app
and
then
continue
on.
E
H
E
A
D
They
I
have
to
okay
6:01
on
the
know
that
on
API
and
some
comments
on
my
PR
for
for
object,
wrapped
yeah,
these
are
all
oh
and
another,
one
which
I
don't
see
here.
For
some
reason,
a
very
good
one
that
I
was
working
on
I,
either
way
they
they're,
they
are
all
sort
of
initiated
by
this
sort
of
showed
up
in
the
repo
whose
github
handle
is
me
tree
very
good
comment,
all
of
them
I'm
just
trying
to
find
that
last
one.
F
H
E
D
So
so
all
we
need
is
just
the
offset
into
the
into
the
instance
of
the
native
class
that
corresponds
to
the
javascript
object
and,
and
that
we
can
we
can
provide
as
a
template
parameter
rather
than
passing
it
in
and
then
storing
in
a
on
the
heap,
because
it
will
not
change
it's
a
constant
really,
and
so
so.
The
idea
here
is
is
to
is
to
basically
provide
a
set
of
methods
for
for
object,
wrap
which,
which
accept
the
the
native
method
that
will
be
exposed
to
JavaScript
as
a
template
parameter
rather
than
a
seminar.
D
D
Method,
for
example,
would
not
be
able
to
to
be
re-implemented;
it
would
have
to
be
a
new
method,
and
so
what
this
amounts
to
is,
that
is
that
we
can,
we
can
add,
a
new
set
of
methods
to
a
switch
except
the
instance
methods
on
the
c++
side
as
template
parameters,
rather
than
rather
than
as
as
function
parameters,
but
that
would
be
a
large
sort
of
cember
minor
additions.
You
define
class
how.
D
D
A
D
D
So
yeah
we
kind
of
want
to
avoid
this
hold.
You
know,
allocate
some
memory
and
and
and
then
and
then
hook
it
onto
on
to
the
class
definition,
and
then
you
leave
it
with
delete
when
the
classes
garbage
basically
avoid
calls
to
attach
that
I
is
what's
right
in
this
case,
it's
possible.
So
the
question
is:
do
we
want
to
add
this?
Do
we
want
to
make
this
major
addition,
and
actually
we
should
also?
We
should
also
start
sort
of
deprecating
the
other
methods,
because
they
are
less
desirable
right.
D
H
D
Our
currently
that's
why
it's
called
instance,
because
this,
but
it
will
not
work
in
fact,
write
implement
this.
We
have
to
call
it
something
other
than
instance
method,
because
the
compiler
cannot
distinguish
the
instance
method.
It
has
no
template
parameters,
an
instance
method
that
has
them
right.
D
Well,
yes,
but
it's
the
only
parameter
right
so,
and
actually
this
is
just
this
is
just
sort
of
a
supported.
Implementation
would
be
more,
there
would
be
the
utf-8
name
and
they
would
also
be
like
Flags,
like
you
know,
is
it
is
it
enumerable?
Is
it
right
up
all
right
all
that
kind
of
thing?
So
so
so
those
flags
would
be
another
parameter,
but
basically
the
instance
mentioned
would
not
be.
One
of
the
parameters
would
rather
be
a
template
parameter.
So.
C
D
H
D
D
C
D
I
I
was
thinking
that,
maybe
you
know
the
existing
methods
they
passed.
The
function
as
a
function
parameter
right.
So
so
in
a
way,
if
we,
if
we
added
a
template,
parameter
that
is
the
same
type
as
the
function
parameter
and
then
you
pass
the
function
parameter
or
you.
You
pass
the
function
as
a
parameter
as
you
do
now.
Then
the
template,
the
template
resolution
mechanism
might
be
able
to
infer
the
fact
that
the
template
parameter
is
the
same
as
the
function
parameter
and
therefore
you
don't
have
to
explicitly
mention
the
template
parameter.
A
D
Don't
know
if
you
can
do
that
right
because,
because
in
in
one
case
the
the
the
function
pointer
is
passed
that
compile
at
at
Bill
and
at
runtime,
whereas
in
the
other
case
the
function
pointer
is,
is
resolved
at
compile
time
right.
So
in
the
template
case,
so
you
cannot
I,
don't
believe
you
can
turn
you
can
call
or
you
can
pass
a
function
pointer
in
as
a
template
parameter.
Okay,.
G
H
D
Have
to
test
it
like
if
we
can
implement
it,
then
then
then,
yes,
I'm,
not
sure
if
you
can
do
it
so
I'm,
not
sure
how
far
the
compiler
goes
to
resolve
these.
These
these
function
pointers
it
may
it
may
just
give
up
when,
when
the
function
pointer
is
being
passed
as
a
function
parameter
rather
than
as
a
template
parameter
so
yeah,
it
might
be
possible
to
re-implement,
but
but
I'd
have
to
check.
D
D
A
D
G
D
Idea,
because
now
we're
relying
on
the
garbage
collector
certain
no
there's,
basically
just
external
bits
of
memory,
just
floating
about
well
they're,
not
floating,
but
okay,
so
that
was
one
and
then
okay.
So
this
is
another
one.
That's
sort
of
debatable
6:01
says
poses
that
we
should
patch
all
the
exceptions
rather
than
just
nappy
ever
I'm,
not
sure
about
this
one.
A
D
So
the
counterproposal
here
is
is
that
is
that
we
we
we
handle.
We
handle
nappy
errors
and
standard
exceptions
which
can
be
turned
into
strings
because
they
have
the
standard
interface
and
then
everything
else
we
should
just
say
an
exception-
was
thrown
so
I
I'm
kind
of
ambivalent,
like
I,
think
I.
Think.
Okay,
the
the
standard
exception
case
sounds
reasonable,
because
we
can
turn
it
into
a
string
which
we
can
then
a
surface
for
the
job.
A
D
D
Yes,
well,
okay,
but
that
that
argument
can
also
be
made
for
for
an
Appy
error
right.
So
you
know
the
thing
that
kind
of
goes
a
little
bit
backwards
to
like
do.
We
want
it
to
crash
like
hard,
even
on
an
Appy
error,
because
right
now
we're
we're
surfacing
and
that
the
error
is
a
JavaScript
exception
right.
A
D
E
D
A
B
A
B
B
D
E
E
D
A
E
A
D
It's
sort
of
the
gatekeeper
between
between
JavaScript
and
and
and
the
native
side-
and
you
know
the
question
is
another
part
of
the
proposal
here
is:
that
is
that
we
allow
a
customizable
exception
handler,
so
I'm
not
sure
how
we
would
do
that
because
our
exception
handler
is
just
a
C
macro,
so
that
got
C
preprocessor
macro,
so
so
that
I
would
I
would
sort
of
make
it
into
like
a
real
function.
I
think
is
I.
D
D
D
I
think
so
yeah
GC
crash
yeah.
So
if
somebody
throws
an
exception
inside
inside
the
constructor,
then
then
then
a
reference
is
created,
but
but
the
instance
of
the
object
wrap
is
destroyed,
and
so
so
when
you
go
to
free
the
instance,
it's
well,
it's
a
double
free.
Okay,
because
the
value
is
never
or
the
reference
the
weak
reference
is
never
removed.
So
so
yeah.
This
is
a
bug
and
there
are.
There
are
different
ways
of
fixing
it,
but
basically
so
I
fixed
it
I
made
two
fixes
here.
D
That
will
try
to
freeze
valid
memory,
but
a
person
named
Dan
Anderson
made
the
point
that
if
we
do
it
that
way,
then
inside
subclass
constructors
people
will
not
be
able
to
call
value
which
is
just
give
me
give
me
the
give
me
did
the
JavaScript
object,
nor
will
they
be
able
to
call
unwrapped,
meaning
give
me
the
the
native
object.
The
counter-argument
came
from
from
a
person
named
Dmitri
ash.
Who
says
that
you
know
inside
the
constructor
of
the
subclass
a
value.
D
D
So
basically,
it's
a
good
point,
because
you
know
if
you,
if
you
access
the,
if
you
access
the
object
before
it's
constructed,
you
you
may
get
a
partially
initialized
object
and
you
shouldn't,
and
so
their
argument
is
that
we
should
construct
the
object
and
then
wrapped
perform
the
wrapping.
And
so
we
have
performed
a
rapping
outside
the
constructor.
But
of
course,
if
there
is
code
out
there
that
that
incorrectly
uses
unwrapping
value
inside
the
constructor,
then
that
code
will
break
because
value
and
unwrap
will
no
longer
be
possible.
A
A
D
Yeah
because
I
mean
okay
yeah
in
a
way,
it
makes
sense,
because
by
the
time
you
get
to
the
subclass
constructor,
the
superclass
constructor,
which
is
the
base
object,
gravity
constructor
will
already
have
run,
so
it
will,
as
the
code
is
currently,
it
will
already
have
established
value
and
it
will
already
have
established
a
working
unwrap
right.
Sorry,.
E
D
You
could
use
value
and
unwrap
in
the
subclass
constructor,
but
why
would
you
write
you
can
instead
of
value
you
can
just
use
like
in
fold
dot
this?
Where
info
is
the
callback
info
instead
of
unwrap
I
mean
you
already
have
the
instance
just
use
this
right,
I
mean
the
C++.
This
keyword
refers
to
the
pointer
which
is
being
stored
inside
the
JavaScript
object.
So
why
would
you
recheck
the
pointer
from
the
JavaScript
object
when
you
already
have
it
available?
There's
the
disk
keyword.
B
D
That's
that's
sort
of
the
argument,
but
yeah
this.
This
may
cause
breakage.
If
people
do
have
this
incorrect
usage,
and
so
so
there's
there's
the
there's
sort
of
debate
like
do
we
want
to
take
the
song
or
not
I
do
have
a
feel
for
it
that
that
avoids
the
crash
right
now
right.
There
is
this
larger
issue
that
was
pointed
out,
but.
D
Well
well,
this
would
be
the
complaint,
let's
see
here
so,
okay,
so,
okay,
yeah,
if
you
look
at,
if
you
look
at
the
comment
two
days
ago
by
dimitri
ash,
they
give
they
give
like
a
javascript
equivalent
of
of
what
is
happening
on
the
c++
side.
So
basically,
so,
basically,
if
you
construct
object
inside
the
constructor
of
the
subclass
and
and
you
pass
the
the
the
subclass
pointer
into
into
that
other
constructor,
then
it
will
receive
an
incompletely
constructed
object.
So,
okay.
A
C
G
D
Because
because
then
it
allows
like
the
the
unwrap.
Basically,
the
argument
being
made
is
that
the
unwrap
and
the
value
should
not
work
inside
the
constructor,
because
the
object
is
not
yet
constructed,
and
so
you
cannot
unwrap
it,
and
so
it
should
not
work.
Whereas
right
now
it
works,
but
only
because
we
built
it
in
such
a
way
that
it
allows
that,
even
though
it
shouldn't
so
that
that's
the
argument
being
made
yeah.
A
So
we
risk
breaking
people,
for
what
benefit
would
be
my
question:
I
guess
yeah
yeah
that
right
like
if
there's
a
strong
like
it
was
like.
Oh,
this
is
terrible
and
we
need
to
make
sure
that
they
don't
they
don't
do
that
and
it's
better
to
do
that
sooner
than
later
or
I
could
understand.
But
if
it's
just
like
well,
it
shouldn't
have
worked,
but
it
does
and
it's
like.
Oh.
A
D
D
Basically,
yeah
you
have
to
redirect,
and
you
know
what
you
want.
The
interesting
part
is
this
fix
that
I
wrote
only
works
because
of
the
fix
you
made
in
core,
which
is
to
to
to
not
delete
the
reference
unless
the
finalizer
has
been
called
and
though
the
finalizer
is
never
called
in
this
case.
The
fact
that
you
you
are
your
code
actually
allows
the
reference
to
be
deleted,
Twice
first
time
it
just
marks
it
as
delete
yourself
and
second
time
it
actually
deletes
it.
D
A
A
A
A
D
E
D
A
E
G
A
G
D
A
D
G
A
D
Okay,
happy
get
sir,
it's
a
function.
Well,
actually
it
always
returns.
Nappy,
okay,
right
now,
the
implementation,
so
there
this
should.
The
fatal
exception
should
never
happen
because
it
just
does
not
return
something
other
than
or
not
be.
Okay,
of
course,
I
have
some
change
in
the
future
right,
but
right
now
this
would
never
ever
under
any
circumstances
unless
there's
a
memory,
corruption
crash.
D
C
A
C
A
A
D
A
A
A
E
A
A
E
I
only
want
to
shout
out
to
it
with
with
you
sure,
I
I
just
push
it
in
the
chat,
but
it's
just
a
first
aid
on
everything:
go
using
an
API.
It's
a
video
so
now
I'm
working
on
to
towards
all
the
API
surface.
But
it's
a
very
good
good
start.
Oh.