WebKit Bugzilla
Attachment 356189 Details for
Bug 192190
: Add first-class support for .mjs files in jsc binary
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-192190-20181130100022.patch (text/plain), 2.53 KB, created by
Dean Jackson
on 2018-11-30 10:00:22 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Dean Jackson
Created:
2018-11-30 10:00:22 PST
Size:
2.53 KB
patch
obsolete
>Subversion Revision: 238578 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index 3585182d6d620a96f1c31417e6f3cd754f35f062..525f62077e5a025079b05b0647710d2b45567ca0 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,19 @@ >+2018-11-30 Dean Jackson <dino@apple.com> >+ >+ Add first-class support for .mjs files in jsc binary >+ https://bugs.webkit.org/show_bug.cgi?id=192190 >+ <rdar://problem/46375715> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Treat files with a .mjs extension as a module, regardless >+ of whether or not the --module-file argument was given. >+ >+ * jsc.cpp: >+ (printUsageStatement): Update usage. >+ (isMJSFile): Helper to look for .mjs extensions. >+ (CommandLine::parseArguments): Pick the appropriate script type. >+ > 2018-11-27 Mark Lam <mark.lam@apple.com> > > [Re-landing] NaNs read from Wasm code needs to be be purified. >diff --git a/Source/JavaScriptCore/jsc.cpp b/Source/JavaScriptCore/jsc.cpp >index e57af0073ab7357e75da53287e3c1a393a3ce8cd..83ba06a9920b66a4fb8374943d28a16ed35d9885 100644 >--- a/Source/JavaScriptCore/jsc.cpp >+++ b/Source/JavaScriptCore/jsc.cpp >@@ -2568,10 +2568,22 @@ static NO_RETURN void printUsageStatement(bool help = false) > fprintf(stderr, " --dumpOptions Dumps all non-default JSC VM options before continuing\n"); > fprintf(stderr, " --<jsc VM option>=<value> Sets the specified JSC VM option\n"); > fprintf(stderr, "\n"); >+ fprintf(stderr, "Files with a .mjs extension will always be evaluated as modules.\n"); >+ fprintf(stderr, "\n"); > > jscExit(help ? EXIT_SUCCESS : EXIT_FAILURE); > } > >+static int isMJSFile(char *filename) >+{ >+ filename = strrchr(filename, '.'); >+ >+ if (!filename) >+ return !strcasecmp(filename, ".mjs"); >+ >+ return 0; >+} >+ > void CommandLine::parseArguments(int argc, char** argv) > { > Options::initialize(); >@@ -2722,7 +2734,8 @@ void CommandLine::parseArguments(int argc, char** argv) > > // This arg is not recognized by the VM nor by jsc. Pass it on to the > // script. >- m_scripts.append(Script(Script::StrictMode::Sloppy, Script::CodeSource::File, Script::ScriptType::Script, argv[i])); >+ Script::ScriptType scriptType = isMJSFile(argv[i]) ? Script::ScriptType::Module : Script::ScriptType::Script; >+ m_scripts.append(Script(Script::StrictMode::Sloppy, Script::CodeSource::File, scriptType, argv[i])); > } > > if (hasBadJSCOptions && JSC::Options::validateOptions())
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
keith_miller
:
review+
ews-watchlist
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 192190
: 356189 |
356219