FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
node-addon-api/test/object/has_own_property.js at main · nodejs/node-addon-api · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
nodejs
/
node-addon-api
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
498
Star
2.4k
Code
Issues
12
Pull requests
4
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
node-addon-api
/
test
/
object
/
has_own_property.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
34 lines (26 loc) · 1.32 KB
Breadcrumbs
node-addon-api
/
test
/
object
/
has_own_property.js
Copy path
File metadata and controls
34 lines (26 loc) · 1.32 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
'use strict'
;
const
assert
=
require
(
'assert'
)
;
module
.
exports
=
require
(
'../common'
)
.
runTest
(
test
)
;
function
test
(
binding
)
{
function
testHasOwnProperty
(
nativeHasOwnProperty
)
{
const
obj
=
{
one
:
1
}
;
Object
.
defineProperty
(
obj
,
'two'
,
{
value
:
2
}
)
;
assert
.
strictEqual
(
nativeHasOwnProperty
(
obj
,
'one'
)
,
true
)
;
assert
.
strictEqual
(
nativeHasOwnProperty
(
obj
,
'two'
)
,
true
)
;
assert
.
strictEqual
(
'toString'
in
obj
,
true
)
;
assert
.
strictEqual
(
nativeHasOwnProperty
(
obj
,
'toString'
)
,
false
)
;
}
function
testShouldThrowErrorIfKeyIsInvalid
(
nativeHasOwnProperty
)
{
assert
.
throws
(
(
)
=>
{
nativeHasOwnProperty
(
undefined
,
'test'
)
;
}
,
/
C
a
n
n
o
t
c
o
n
v
e
r
t
u
n
d
e
f
i
n
e
d
o
r
n
u
l
l
t
o
o
b
j
e
c
t
/
)
;
}
testHasOwnProperty
(
binding
.
object
.
hasOwnPropertyWithNapiValue
)
;
testHasOwnProperty
(
binding
.
object
.
hasOwnPropertyWithNapiWrapperValue
)
;
testHasOwnProperty
(
binding
.
object
.
hasOwnPropertyWithCStyleString
)
;
testHasOwnProperty
(
binding
.
object
.
hasOwnPropertyWithCppStyleString
)
;
testShouldThrowErrorIfKeyIsInvalid
(
binding
.
object
.
hasOwnPropertyWithNapiValue
)
;
testShouldThrowErrorIfKeyIsInvalid
(
binding
.
object
.
hasOwnPropertyWithNapiWrapperValue
)
;
testShouldThrowErrorIfKeyIsInvalid
(
binding
.
object
.
hasOwnPropertyWithCStyleString
)
;
testShouldThrowErrorIfKeyIsInvalid
(
binding
.
object
.
hasOwnPropertyWithCppStyleString
)
;
}
Back
|
FazBrowse Home
|
New Git URL