Skip to content

Commit 9d03621

Browse files
authored
Use JS string.startsWith. NFC (#19278)
1 parent 6a546c2 commit 9d03621

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/modules.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -283,10 +283,6 @@ function cDefine(key) {
283283
return cDefs[key];
284284
}
285285

286-
function isFSPrefixed(name) {
287-
return name.length > 3 && name[0] === 'F' && name[1] === 'S' && name[2] === '_';
288-
}
289-
290286
function isInternalSymbol(ident) {
291287
return ident + '__internal' in LibraryManager.library;
292288
}
@@ -342,7 +338,7 @@ function exportRuntime() {
342338
if (EXPORTED_RUNTIME_METHODS_SET.has(name)) {
343339
let exported = name;
344340
// the exported name may differ from the internal name
345-
if (isFSPrefixed(exported)) {
341+
if (exported.startsWith('FS_')) {
346342
// this is a filesystem value, FS.x exported as FS_x
347343
exported = 'FS.' + exported.substr(3);
348344
} else if (legacyRuntimeElements.has(exported)) {

0 commit comments

Comments
 (0)