Changeset 189431 in webkit


Ignore:
Timestamp:
Sep 5, 2015 12:44:35 AM (9 years ago)
Author:
Yusuke Suzuki
Message:

[ES6] Enable ES6 Module in JSC shell by default
https://bugs.webkit.org/show_bug.cgi?id=148689

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

Enable ES6 Modules in JSC shell by default. Compile time flag is left for WebCore.
Since the entry point to evaluate the modules are completely separated from the usual
entry point to evaluate the script, we can safely enable ES6 modules in JSC shell.

And add bunch of tests for ES6 Modules.

  • jsc.cpp:

(GlobalObject::finishCreation):
(functionLoadModule):
(runWithScripts):
(printUsageStatement): Deleted.
(CommandLine::parseArguments): Deleted.

  • parser/Parser.cpp:

(JSC::Parser<LexerType>::parseInner): Deleted.

  • tests/modules.yaml: Added.
  • tests/modules/aliasing.js: Added.
  • tests/modules/aliasing/drink-2.js: Added.

(export.let.Cappuccino.string_appeared_here.export.changeCappuccino):

  • tests/modules/aliasing/drink.js: Added.

(export.changeCocoa):

  • tests/modules/cyclic-may-produce-tdz.js: Added.
  • tests/modules/cyclic-may-produce-tdz/1.js: Added.
  • tests/modules/cyclic-may-produce-tdz/2.js: Added.
  • tests/modules/default-error/main.js: Added.
  • tests/modules/default-value-case-should-be-copied.js: Added.
  • tests/modules/default-value-case-should-be-copied/module.js: Added.

(export.changeValue):

  • tests/modules/defaults.js: Added.
  • tests/modules/defaults/Cappuccino.js: Added.
  • tests/modules/defaults/Cocoa.js: Added.

(export.default.Cocoa):

  • tests/modules/defaults/Matcha.js: Added.
  • tests/modules/destructuring-export.js: Added.
  • tests/modules/destructuring-export/array.js: Added.
  • tests/modules/destructuring-export/main.js: Added.
  • tests/modules/execution-order-cyclic.js: Added.
  • tests/modules/execution-order-cyclic/1.js: Added.
  • tests/modules/execution-order-cyclic/10.js: Added.
  • tests/modules/execution-order-cyclic/11.js: Added.
  • tests/modules/execution-order-cyclic/2.js: Added.
  • tests/modules/execution-order-cyclic/3.js: Added.
  • tests/modules/execution-order-cyclic/4.js: Added.
  • tests/modules/execution-order-cyclic/5.js: Added.
  • tests/modules/execution-order-cyclic/6.js: Added.
  • tests/modules/execution-order-cyclic/7.js: Added.
  • tests/modules/execution-order-cyclic/8.js: Added.
  • tests/modules/execution-order-cyclic/9.js: Added.
  • tests/modules/execution-order-dag.js: Added.
  • tests/modules/execution-order-dag/1.js: Added.
  • tests/modules/execution-order-dag/10.js: Added.
  • tests/modules/execution-order-dag/2.js: Added.
  • tests/modules/execution-order-dag/3.js: Added.
  • tests/modules/execution-order-dag/4.js: Added.
  • tests/modules/execution-order-dag/5.js: Added.
  • tests/modules/execution-order-dag/6.js: Added.
  • tests/modules/execution-order-dag/7.js: Added.
  • tests/modules/execution-order-dag/8.js: Added.
  • tests/modules/execution-order-dag/9.js: Added.
  • tests/modules/execution-order-depth.js: Added.
  • tests/modules/execution-order-depth/1.js: Added.
  • tests/modules/execution-order-depth/2.js: Added.
  • tests/modules/execution-order-depth/3.js: Added.
  • tests/modules/execution-order-self.js: Added.
  • tests/modules/execution-order-sibling.js: Added.
  • tests/modules/execution-order-sibling/1.js: Added.
  • tests/modules/execution-order-sibling/2.js: Added.
  • tests/modules/execution-order-sibling/3.js: Added.
  • tests/modules/execution-order-tree.js: Added.
  • tests/modules/execution-order-tree/1.js: Added.
  • tests/modules/execution-order-tree/10.js: Added.
  • tests/modules/execution-order-tree/11.js: Added.
  • tests/modules/execution-order-tree/2.js: Added.
  • tests/modules/execution-order-tree/3.js: Added.
  • tests/modules/execution-order-tree/4.js: Added.
  • tests/modules/execution-order-tree/5.js: Added.
  • tests/modules/execution-order-tree/6.js: Added.
  • tests/modules/execution-order-tree/7.js: Added.
  • tests/modules/execution-order-tree/8.js: Added.
  • tests/modules/execution-order-tree/9.js: Added.
  • tests/modules/export-conflict-ok.js: Added.
  • tests/modules/export-conflict-ok/A.js: Added.
  • tests/modules/export-conflict-ok/B.js: Added.
  • tests/modules/export-conflict-ok/main.js: Added.
  • tests/modules/export-from.js: Added.
  • tests/modules/export-from/main.js: Added.
  • tests/modules/export-from/second.js: Added.
  • tests/modules/export-with-declarations-list.js: Added.
  • tests/modules/export-with-declarations-list/main.js: Added.
  • tests/modules/exported-function-may-be-called-before-module-is-executed.js: Added.
  • tests/modules/exported-function-may-be-called-before-module-is-executed/1.js: Added.
  • tests/modules/exported-function-may-be-called-before-module-is-executed/2.js: Added.

(export.add):
(export.raise):

  • tests/modules/import-error.js: Added.
  • tests/modules/import-error/export-ambiguous-1.js: Added.
  • tests/modules/import-error/export-ambiguous-2.js: Added.
  • tests/modules/import-error/export-ambiguous.js: Added.
  • tests/modules/import-error/export-default-from-star-2.js: Added.

(export.default.Cocoa):

  • tests/modules/import-error/export-default-from-star.js: Added.
  • tests/modules/import-error/export-not-found.js: Added.
  • tests/modules/import-error/import-ambiguous.js: Added.
  • tests/modules/import-error/import-default-from-star.js: Added.
  • tests/modules/import-error/import-not-found.js: Added.
  • tests/modules/imported-bindings-are-immutable.js: Added.
  • tests/modules/imported-bindings-are-immutable/bindings.js: Added.

(export.functionDeclaration):
(export.classDeclaration):

  • tests/modules/imported-bindings-can-be-changed-in-original-module.js: Added.
  • tests/modules/imported-bindings-can-be-changed-in-original-module/bindings.js: Added.
  • tests/modules/indirect-export-error.js: Added.
  • tests/modules/indirect-export-error/indirect-export-ambiguous-2.js: Added.
  • tests/modules/indirect-export-error/indirect-export-ambiguous-3.js: Added.
  • tests/modules/indirect-export-error/indirect-export-ambiguous-4.js: Added.
  • tests/modules/indirect-export-error/indirect-export-ambiguous.js: Added.
  • tests/modules/indirect-export-error/indirect-export-default-2.js: Added.
  • tests/modules/indirect-export-error/indirect-export-default-3.js: Added.

(export.default.Cocoa):

  • tests/modules/indirect-export-error/indirect-export-default.js: Added.
  • tests/modules/indirect-export-error/indirect-export-not-found-2.js: Added.
  • tests/modules/indirect-export-error/indirect-export-not-found.js: Added.
  • tests/modules/module-eval.js: Added.
  • tests/modules/module-eval/A.js: Added.
  • tests/modules/module-eval/B.js: Added.
  • tests/modules/module-eval/drink.js: Added.
  • tests/modules/module-is-strict-code.js: Added.
  • tests/modules/namespace-ambiguous.js: Added.
  • tests/modules/namespace-ambiguous/ambiguous-2.js: Added.
  • tests/modules/namespace-ambiguous/ambiguous-3.js: Added.
  • tests/modules/namespace-ambiguous/ambiguous-4.js: Added.
  • tests/modules/namespace-ambiguous/ambiguous.js: Added.
  • tests/modules/namespace-error.js: Added.
  • tests/modules/namespace-error/namespace-local-error-should-hide-global-ambiguity-2.js: Added.
  • tests/modules/namespace-error/namespace-local-error-should-hide-global-ambiguity-3.js: Added.
  • tests/modules/namespace-error/namespace-local-error-should-hide-global-ambiguity-4.js: Added.
  • tests/modules/namespace-error/namespace-local-error-should-hide-global-ambiguity-5.js: Added.
  • tests/modules/namespace-error/namespace-local-error-should-hide-global-ambiguity-6.js: Added.
  • tests/modules/namespace-error/namespace-local-error-should-hide-global-ambiguity-7.js: Added.
  • tests/modules/namespace-error/namespace-local-error-should-hide-global-ambiguity.js: Added.
  • tests/modules/namespace-tdz.js: Added.
  • tests/modules/namespace-tdz/A.js: Added.
  • tests/modules/namespace-tdz/B.js: Added.

(export.later):

  • tests/modules/namespace-tdz/main.js: Added.
  • tests/modules/namespace.js: Added.
  • tests/modules/namespace/additional-drink.js: Added.
  • tests/modules/namespace/drink.js: Added.

(export.default.changeCappuccino):

  • tests/modules/namespace/more-additional-drink.js: Added.
  • tests/modules/resources/assert.js: Added.

(export.shouldBe):
(export.shouldThrow):

  • tests/modules/scopes.js: Added.
  • tests/modules/scopes/additional-drink.js: Added.
  • tests/modules/scopes/drink.js: Added.

(export.default.changeCappuccino):

  • tests/modules/scopes/more-additional-drink.js: Added.
  • tests/modules/this-should-be-undefined.js: Added.
  • tests/stress/modules-syntax-error-with-names.js:
  • tests/stress/modules-syntax-error.js:
  • tests/stress/modules-syntax.js:

Tools:

  • Scripts/run-javascriptcore-tests:

(runJSCStressTests):

  • Scripts/run-jsc-stress-tests:
Location:
trunk
Files:
156 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r189429 r189431  
     12015-09-05  Yusuke Suzuki  <utatane.tea@gmail.com>
     2
     3        [ES6] Enable ES6 Module in JSC shell by default
     4        https://bugs.webkit.org/show_bug.cgi?id=148689
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        Enable ES6 Modules in JSC shell by default. Compile time flag is left for WebCore.
     9        Since the entry point to evaluate the modules are completely separated from the usual
     10        entry point to evaluate the script, we can safely enable ES6 modules in JSC shell.
     11
     12        And add bunch of tests for ES6 Modules.
     13
     14        * jsc.cpp:
     15        (GlobalObject::finishCreation):
     16        (functionLoadModule):
     17        (runWithScripts):
     18        (printUsageStatement): Deleted.
     19        (CommandLine::parseArguments): Deleted.
     20        * parser/Parser.cpp:
     21        (JSC::Parser<LexerType>::parseInner): Deleted.
     22        * tests/modules.yaml: Added.
     23        * tests/modules/aliasing.js: Added.
     24        * tests/modules/aliasing/drink-2.js: Added.
     25        (export.let.Cappuccino.string_appeared_here.export.changeCappuccino):
     26        * tests/modules/aliasing/drink.js: Added.
     27        (export.changeCocoa):
     28        * tests/modules/cyclic-may-produce-tdz.js: Added.
     29        * tests/modules/cyclic-may-produce-tdz/1.js: Added.
     30        * tests/modules/cyclic-may-produce-tdz/2.js: Added.
     31        * tests/modules/default-error/main.js: Added.
     32        * tests/modules/default-value-case-should-be-copied.js: Added.
     33        * tests/modules/default-value-case-should-be-copied/module.js: Added.
     34        (export.changeValue):
     35        * tests/modules/defaults.js: Added.
     36        * tests/modules/defaults/Cappuccino.js: Added.
     37        * tests/modules/defaults/Cocoa.js: Added.
     38        (export.default.Cocoa):
     39        * tests/modules/defaults/Matcha.js: Added.
     40        * tests/modules/destructuring-export.js: Added.
     41        * tests/modules/destructuring-export/array.js: Added.
     42        * tests/modules/destructuring-export/main.js: Added.
     43        * tests/modules/execution-order-cyclic.js: Added.
     44        * tests/modules/execution-order-cyclic/1.js: Added.
     45        * tests/modules/execution-order-cyclic/10.js: Added.
     46        * tests/modules/execution-order-cyclic/11.js: Added.
     47        * tests/modules/execution-order-cyclic/2.js: Added.
     48        * tests/modules/execution-order-cyclic/3.js: Added.
     49        * tests/modules/execution-order-cyclic/4.js: Added.
     50        * tests/modules/execution-order-cyclic/5.js: Added.
     51        * tests/modules/execution-order-cyclic/6.js: Added.
     52        * tests/modules/execution-order-cyclic/7.js: Added.
     53        * tests/modules/execution-order-cyclic/8.js: Added.
     54        * tests/modules/execution-order-cyclic/9.js: Added.
     55        * tests/modules/execution-order-dag.js: Added.
     56        * tests/modules/execution-order-dag/1.js: Added.
     57        * tests/modules/execution-order-dag/10.js: Added.
     58        * tests/modules/execution-order-dag/2.js: Added.
     59        * tests/modules/execution-order-dag/3.js: Added.
     60        * tests/modules/execution-order-dag/4.js: Added.
     61        * tests/modules/execution-order-dag/5.js: Added.
     62        * tests/modules/execution-order-dag/6.js: Added.
     63        * tests/modules/execution-order-dag/7.js: Added.
     64        * tests/modules/execution-order-dag/8.js: Added.
     65        * tests/modules/execution-order-dag/9.js: Added.
     66        * tests/modules/execution-order-depth.js: Added.
     67        * tests/modules/execution-order-depth/1.js: Added.
     68        * tests/modules/execution-order-depth/2.js: Added.
     69        * tests/modules/execution-order-depth/3.js: Added.
     70        * tests/modules/execution-order-self.js: Added.
     71        * tests/modules/execution-order-sibling.js: Added.
     72        * tests/modules/execution-order-sibling/1.js: Added.
     73        * tests/modules/execution-order-sibling/2.js: Added.
     74        * tests/modules/execution-order-sibling/3.js: Added.
     75        * tests/modules/execution-order-tree.js: Added.
     76        * tests/modules/execution-order-tree/1.js: Added.
     77        * tests/modules/execution-order-tree/10.js: Added.
     78        * tests/modules/execution-order-tree/11.js: Added.
     79        * tests/modules/execution-order-tree/2.js: Added.
     80        * tests/modules/execution-order-tree/3.js: Added.
     81        * tests/modules/execution-order-tree/4.js: Added.
     82        * tests/modules/execution-order-tree/5.js: Added.
     83        * tests/modules/execution-order-tree/6.js: Added.
     84        * tests/modules/execution-order-tree/7.js: Added.
     85        * tests/modules/execution-order-tree/8.js: Added.
     86        * tests/modules/execution-order-tree/9.js: Added.
     87        * tests/modules/export-conflict-ok.js: Added.
     88        * tests/modules/export-conflict-ok/A.js: Added.
     89        * tests/modules/export-conflict-ok/B.js: Added.
     90        * tests/modules/export-conflict-ok/main.js: Added.
     91        * tests/modules/export-from.js: Added.
     92        * tests/modules/export-from/main.js: Added.
     93        * tests/modules/export-from/second.js: Added.
     94        * tests/modules/export-with-declarations-list.js: Added.
     95        * tests/modules/export-with-declarations-list/main.js: Added.
     96        * tests/modules/exported-function-may-be-called-before-module-is-executed.js: Added.
     97        * tests/modules/exported-function-may-be-called-before-module-is-executed/1.js: Added.
     98        * tests/modules/exported-function-may-be-called-before-module-is-executed/2.js: Added.
     99        (export.add):
     100        (export.raise):
     101        * tests/modules/import-error.js: Added.
     102        * tests/modules/import-error/export-ambiguous-1.js: Added.
     103        * tests/modules/import-error/export-ambiguous-2.js: Added.
     104        * tests/modules/import-error/export-ambiguous.js: Added.
     105        * tests/modules/import-error/export-default-from-star-2.js: Added.
     106        (export.default.Cocoa):
     107        * tests/modules/import-error/export-default-from-star.js: Added.
     108        * tests/modules/import-error/export-not-found.js: Added.
     109        * tests/modules/import-error/import-ambiguous.js: Added.
     110        * tests/modules/import-error/import-default-from-star.js: Added.
     111        * tests/modules/import-error/import-not-found.js: Added.
     112        * tests/modules/imported-bindings-are-immutable.js: Added.
     113        * tests/modules/imported-bindings-are-immutable/bindings.js: Added.
     114        (export.functionDeclaration):
     115        (export.classDeclaration):
     116        * tests/modules/imported-bindings-can-be-changed-in-original-module.js: Added.
     117        * tests/modules/imported-bindings-can-be-changed-in-original-module/bindings.js: Added.
     118        * tests/modules/indirect-export-error.js: Added.
     119        * tests/modules/indirect-export-error/indirect-export-ambiguous-2.js: Added.
     120        * tests/modules/indirect-export-error/indirect-export-ambiguous-3.js: Added.
     121        * tests/modules/indirect-export-error/indirect-export-ambiguous-4.js: Added.
     122        * tests/modules/indirect-export-error/indirect-export-ambiguous.js: Added.
     123        * tests/modules/indirect-export-error/indirect-export-default-2.js: Added.
     124        * tests/modules/indirect-export-error/indirect-export-default-3.js: Added.
     125        (export.default.Cocoa):
     126        * tests/modules/indirect-export-error/indirect-export-default.js: Added.
     127        * tests/modules/indirect-export-error/indirect-export-not-found-2.js: Added.
     128        * tests/modules/indirect-export-error/indirect-export-not-found.js: Added.
     129        * tests/modules/module-eval.js: Added.
     130        * tests/modules/module-eval/A.js: Added.
     131        * tests/modules/module-eval/B.js: Added.
     132        * tests/modules/module-eval/drink.js: Added.
     133        * tests/modules/module-is-strict-code.js: Added.
     134        * tests/modules/namespace-ambiguous.js: Added.
     135        * tests/modules/namespace-ambiguous/ambiguous-2.js: Added.
     136        * tests/modules/namespace-ambiguous/ambiguous-3.js: Added.
     137        * tests/modules/namespace-ambiguous/ambiguous-4.js: Added.
     138        * tests/modules/namespace-ambiguous/ambiguous.js: Added.
     139        * tests/modules/namespace-error.js: Added.
     140        * tests/modules/namespace-error/namespace-local-error-should-hide-global-ambiguity-2.js: Added.
     141        * tests/modules/namespace-error/namespace-local-error-should-hide-global-ambiguity-3.js: Added.
     142        * tests/modules/namespace-error/namespace-local-error-should-hide-global-ambiguity-4.js: Added.
     143        * tests/modules/namespace-error/namespace-local-error-should-hide-global-ambiguity-5.js: Added.
     144        * tests/modules/namespace-error/namespace-local-error-should-hide-global-ambiguity-6.js: Added.
     145        * tests/modules/namespace-error/namespace-local-error-should-hide-global-ambiguity-7.js: Added.
     146        * tests/modules/namespace-error/namespace-local-error-should-hide-global-ambiguity.js: Added.
     147        * tests/modules/namespace-tdz.js: Added.
     148        * tests/modules/namespace-tdz/A.js: Added.
     149        * tests/modules/namespace-tdz/B.js: Added.
     150        (export.later):
     151        * tests/modules/namespace-tdz/main.js: Added.
     152        * tests/modules/namespace.js: Added.
     153        * tests/modules/namespace/additional-drink.js: Added.
     154        * tests/modules/namespace/drink.js: Added.
     155        (export.default.changeCappuccino):
     156        * tests/modules/namespace/more-additional-drink.js: Added.
     157        * tests/modules/resources/assert.js: Added.
     158        (export.shouldBe):
     159        (export.shouldThrow):
     160        * tests/modules/scopes.js: Added.
     161        * tests/modules/scopes/additional-drink.js: Added.
     162        * tests/modules/scopes/drink.js: Added.
     163        (export.default.changeCappuccino):
     164        * tests/modules/scopes/more-additional-drink.js: Added.
     165        * tests/modules/this-should-be-undefined.js: Added.
     166        * tests/stress/modules-syntax-error-with-names.js:
     167        * tests/stress/modules-syntax-error.js:
     168        * tests/stress/modules-syntax.js:
     169
    11702015-09-05  Yusuke Suzuki  <utatane.tea@gmail.com>
    2171
  • trunk/Source/JavaScriptCore/jsc.cpp

    r189160 r189431  
    500500static EncodedJSValue JSC_HOST_CALL functionLoadWebAssembly(ExecState*);
    501501#endif
    502 #if ENABLE(ES6_MODULES)
     502static EncodedJSValue JSC_HOST_CALL functionLoadModule(ExecState*);
    503503static EncodedJSValue JSC_HOST_CALL functionCheckModuleSyntax(ExecState*);
    504 #endif
    505504
    506505#if ENABLE(SAMPLING_FLAGS)
     
    679678        addFunction(vm, "loadWebAssembly", functionLoadWebAssembly, 1);
    680679#endif
    681 #if ENABLE(ES6_MODULES)
     680        addFunction(vm, "loadModule", functionLoadModule, 1);
    682681        addFunction(vm, "checkModuleSyntax", functionCheckModuleSyntax, 1);
    683 #endif
    684682
    685683        JSArray* array = constructEmptyArray(globalExec(), 0);
     
    13611359#endif
    13621360
    1363 #if ENABLE(ES6_MODULES)
     1361EncodedJSValue JSC_HOST_CALL functionLoadModule(ExecState* exec)
     1362{
     1363    String fileName = exec->argument(0).toString(exec)->value(exec);
     1364    Vector<char> script;
     1365    if (!fillBufferWithContentsOfFile(fileName, script))
     1366        return JSValue::encode(exec->vm().throwException(exec, createError(exec, ASCIILiteral("Could not open file."))));
     1367
     1368    JSInternalPromise* promise = evaluateModule(exec, fileName);
     1369    if (exec->hadException())
     1370        return JSValue::encode(jsUndefined());
     1371
     1372    JSValue error;
     1373    JSFunction* errorHandler = JSNativeStdFunction::create(exec->vm(), exec->lexicalGlobalObject(), 1, String(), [&](ExecState* exec) {
     1374        error = exec->argument(0);
     1375        return JSValue::encode(jsUndefined());
     1376    });
     1377
     1378    promise->then(exec, nullptr, errorHandler);
     1379    exec->vm().drainMicrotasks();
     1380    if (error)
     1381        return JSValue::encode(exec->vm().throwException(exec, error));
     1382    return JSValue::encode(jsUndefined());
     1383}
     1384
    13641385EncodedJSValue JSC_HOST_CALL functionCheckModuleSyntax(ExecState* exec)
    13651386{
     
    13771398    return JSValue::encode(jsNumber(stopWatch.getElapsedMS()));
    13781399}
    1379 #endif
    13801400
    13811401// Use SEH for Release builds only to get rid of the crash report dialog
     
    15051525    bool success = true;
    15061526
    1507 #if ENABLE(ES6_MODULES)
    15081527    JSFunction* errorHandler = JSNativeStdFunction::create(vm, globalObject, 1, String(), [&](ExecState* exec) {
    15091528        success = false;
     
    15111530        return JSValue::encode(jsUndefined());
    15121531    });
    1513 #endif
    15141532
    15151533#if ENABLE(SAMPLING_FLAGS)
     
    15181536
    15191537    for (size_t i = 0; i < scripts.size(); i++) {
    1520 #if ENABLE(ES6_MODULES)
    15211538        JSInternalPromise* promise = nullptr;
    1522 #endif
    15231539        if (scripts[i].isFile) {
    15241540            fileName = scripts[i].argument;
    1525             if (module) {
    1526 #if ENABLE(ES6_MODULES)
     1541            if (module)
    15271542                promise = evaluateModule(globalObject->globalExec(), fileName);
    1528 #else
    1529                 RELEASE_ASSERT_NOT_REACHED();
    1530 #endif
    1531             } else {
     1543            else {
    15321544                if (!fillBufferWithContentsOfFile(fileName, scriptBuffer))
    15331545                    return false; // fail early so we can catch missing files
     
    15421554
    15431555        if (module) {
    1544 #if ENABLE(ES6_MODULES)
    15451556            if (!promise)
    15461557                promise = evaluateModule(globalObject->globalExec(), jscSource(script, fileName));
     
    15481559            promise->then(globalObject->globalExec(), nullptr, errorHandler);
    15491560            globalObject->vm().drainMicrotasks();
    1550 #else
    1551             RELEASE_ASSERT_NOT_REACHED();
    1552 #endif
    15531561        } else {
    15541562            NakedPtr<Exception> evaluationException;
     
    16491657    fprintf(stderr, "  -h|--help  Prints this help message\n");
    16501658    fprintf(stderr, "  -i         Enables interactive mode (default if no files are specified)\n");
    1651 #if ENABLE(ES6_MODULES)
    16521659    fprintf(stderr, "  -m         Execute as a module\n");
    1653 #endif
    16541660#if HAVE(SIGNAL_H)
    16551661    fprintf(stderr, "  -s         Installs signal handlers that exit on a crash (Unix platforms only)\n");
     
    17031709            continue;
    17041710        }
    1705 #if ENABLE(ES6_MODULES)
    17061711        if (!strcmp(arg, "-m")) {
    17071712            m_module = true;
    17081713            continue;
    17091714        }
    1710 #endif
    17111715        if (!strcmp(arg, "-s")) {
    17121716#if HAVE(SIGNAL_H)
  • trunk/Source/JavaScriptCore/parser/Parser.cpp

    r189371 r189431  
    270270        if (isArrowFunctionBodyExpression)
    271271            sourceElements = parseArrowFunctionSingleExpressionBodySourceElements(context);
    272 #if ENABLE(ES6_MODULES)
    273272        else if (isModuleParseMode(parseMode))
    274273            sourceElements = parseModuleSourceElements(context, parseMode);
    275 #endif
    276274        else
    277275            sourceElements = parseSourceElements(context, CheckForStrictMode);
  • trunk/Source/JavaScriptCore/tests/stress/modules-syntax-error-with-names.js

    r188417 r189431  
    1 //@ skip
    2 
    31function shouldThrow(func, errorMessage) {
    42    var errorThrown = false;
  • trunk/Source/JavaScriptCore/tests/stress/modules-syntax-error.js

    r187890 r189431  
    1 //@ skip
    2 
    31function shouldThrow(func, errorMessage) {
    42    var errorThrown = false;
  • trunk/Source/JavaScriptCore/tests/stress/modules-syntax.js

    r187890 r189431  
    1 //@ skip
    2 
    31checkModuleSyntax(String.raw`
    42import "Cocoa";
  • trunk/Tools/ChangeLog

    r189409 r189431  
     12015-09-05  Yusuke Suzuki  <utatane.tea@gmail.com>
     2
     3        [ES6] Enable ES6 Module in JSC shell by default
     4        https://bugs.webkit.org/show_bug.cgi?id=148689
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        * Scripts/run-javascriptcore-tests:
     9        (runJSCStressTests):
     10        * Scripts/run-jsc-stress-tests:
     11
    1122015-09-04  Basile Clement  <basile_clement@apple.com>
    213
  • trunk/Tools/Scripts/run-javascriptcore-tests

    r189333 r189431  
    286286        "Source/JavaScriptCore/tests/controlFlowProfiler.yaml",
    287287        "Source/JavaScriptCore/tests/es6.yaml",
     288        "Source/JavaScriptCore/tests/modules.yaml",
    288289    );
    289290    if (isWindows() && !isCygwin()) {
  • trunk/Tools/Scripts/run-jsc-stress-tests

    r189333 r189431  
    900900end
    901901
     902def runModules
     903    run("default-modules", "-m")
     904    run("always-trigger-copy-phase-modules", "-m", "--minHeapUtilization=2.0", "--minCopiedBlockUtilization=2.0")
     905
     906    if !$jitTests
     907        return
     908    end
     909
     910    run("no-llint-modules", "-m", "--useLLInt=false")
     911    run("no-cjit-validate-phases-modules", "-m", "--validateBytecode=true", "--validateGraphAtEachPhase=true", *NO_CJIT_OPTIONS)
     912    run("dfg-eager-modules", "-m", *EAGER_OPTIONS)
     913    run("dfg-eager-no-cjit-validate-modules", "-m", "--validateGraph=true", *(NO_CJIT_OPTIONS + EAGER_OPTIONS))
     914    if $enableFTL
     915        run("default-ftl-modules", "-m", *FTL_OPTIONS)
     916        run("ftl-no-cjit-validate-modules", "-m", "--validateGraph=true", *(FTL_OPTIONS + NO_CJIT_OPTIONS))
     917        run("ftl-no-cjit-no-inline-validate-modules", "-m", "--validateGraph=true", "--maximumInliningDepth=1", *(FTL_OPTIONS + NO_CJIT_OPTIONS))
     918        run("ftl-eager-modules", "-m", *(FTL_OPTIONS + EAGER_OPTIONS))
     919        run("ftl-eager-no-cjit-modules", "-m", "--validateGraph=true", *(FTL_OPTIONS + NO_CJIT_OPTIONS + EAGER_OPTIONS))
     920        run("ftl-no-cjit-small-pool-modules", "-m", "--jitMemoryReservationSize=50000", *(FTL_OPTIONS + NO_CJIT_OPTIONS))
     921    end
     922end
     923
    902924def runLayoutTest(kind, *options)
    903925    raise unless $benchmark.to_s =~ /\.js$/
Note: See TracChangeset for help on using the changeset viewer.