Skip to content

Commit 2432911

Browse files
authored
[embind] Simplify makeLegalFunctionName. NFC (#22714)
This function only has a single call site and that argument passed cannot be undefined. Include an assertion just in case.
1 parent 584b469 commit 2432911

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/embind/embind.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2269,9 +2269,9 @@ var LibraryEmbind = {
22692269
$char_9: '9'.charCodeAt(0),
22702270
$makeLegalFunctionName__deps: ['$char_0', '$char_9'],
22712271
$makeLegalFunctionName: (name) => {
2272-
if (undefined === name) {
2273-
return '_unknown';
2274-
}
2272+
#if ASSERTIONS
2273+
assert(typeof name === 'string');
2274+
#endif
22752275
name = name.replace(/[^a-zA-Z0-9_]/g, '$');
22762276
var f = name.charCodeAt(0);
22772277
if (f >= char_0 && f <= char_9) {

0 commit comments

Comments
 (0)