Skip to content

Commit 176035d

Browse files
authored
Avoid __postset for ERRNO_CODES. NFC (#20518)
We can just use a string literal here.
1 parent a534308 commit 176035d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/library.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1250,7 +1250,9 @@ addToLibrary({
12501250
// errno.h
12511251
// ==========================================================================
12521252

1253-
$ERRNO_CODES__postset: `ERRNO_CODES = {
1253+
// We use a string literal here to avoid the string quotes on the object
1254+
// keys being removed when processed by jsifier.
1255+
$ERRNO_CODES: `{
12541256
'EPERM': {{{ cDefs.EPERM }}},
12551257
'ENOENT': {{{ cDefs.ENOENT }}},
12561258
'ESRCH': {{{ cDefs.ESRCH }}},
@@ -1372,8 +1374,7 @@ addToLibrary({
13721374
'ENOTRECOVERABLE': {{{ cDefs.ENOTRECOVERABLE }}},
13731375
'EOWNERDEAD': {{{ cDefs.EOWNERDEAD }}},
13741376
'ESTRPIPE': {{{ cDefs.ESTRPIPE }}},
1375-
};`,
1376-
$ERRNO_CODES: {},
1377+
}`,
13771378
$ERRNO_MESSAGES: {
13781379
0: 'Success',
13791380
{{{ cDefs.EPERM }}}: 'Not super-user',

0 commit comments

Comments
 (0)