Bug 148689

Summary: [ES6] Enable ES6 Module in JSC shell by default
Product: WebKit Reporter: Yusuke Suzuki <ysuzuki>
Component: JavaScriptCoreAssignee: Yusuke Suzuki <ysuzuki>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, bfulgham, fpizlo, ggaren, ossy, saam, sam
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 148053, 148705    
Bug Blocks: 147340    
Attachments:
Description Flags
Patch
none
Patch ggaren: review+

Description Yusuke Suzuki 2015-09-01 14:44:04 PDT
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.
Comment 1 Yusuke Suzuki 2015-09-02 14:27:14 PDT
Created attachment 260439 [details]
Patch
Comment 2 Yusuke Suzuki 2015-09-02 14:27:40 PDT
This patch is based on the https://bugs.webkit.org/show_bug.cgi?id=148705 and https://bugs.webkit.org/show_bug.cgi?id=148053.
Comment 3 Yusuke Suzuki 2015-09-03 23:29:58 PDT
Created attachment 260571 [details]
Patch
Comment 4 Geoffrey Garen 2015-09-04 14:24:41 PDT
Comment on attachment 260571 [details]
Patch

r=me
Comment 5 Yusuke Suzuki 2015-09-05 00:44:45 PDT
Committed r189431: <http://trac.webkit.org/changeset/189431>
Comment 6 Csaba Osztrogonác 2015-09-05 06:39:22 PDT
(In reply to comment #5)
> Committed r189431: <http://trac.webkit.org/changeset/189431>

There are 162 failures on the Apple Windows buildbots.
Comment 7 Yusuke Suzuki 2015-09-05 09:12:00 PDT
(In reply to comment #6)
> (In reply to comment #5)
> > Committed r189431: <http://trac.webkit.org/changeset/189431>
> 
> There are 162 failures on the Apple Windows buildbots.

I'll look into it.
Comment 8 Yusuke Suzuki 2015-09-05 09:20:52 PDT
Ah, ok. I've found the problem.
Now, we specify the module path with UNIX path separator like,

`import A from "A/main.js"`.

We already represents the current path with `\\` style.
However, when concatenating the current path + the module path,
we did not convert the module path to `\\` style.
This causes the incorrect path like,

`C:\cygwin\home\buildbot\slave\win-debug-tests\build\WebKitBuild\Debug\bin32\jsc-stress-results\.tests\modules.yaml\modules\im\./resources/assert.js`

I'll submit the unreviewed attempt to fix patch.
Comment 9 Yusuke Suzuki 2015-09-05 14:07:34 PDT
The incorrect path peoblem seems solved.
But it seems that the current working directory path seems truncated.
I'll now checking...
(I guess it is due to too long path name)
Comment 10 Yusuke Suzuki 2015-09-05 15:23:39 PDT
OK, the problem is,
the max path of the Windows is limited and short (260),
Modules in JSC shell uses an absolute path as an unique key to each module, so files are opened by an absolute path. Do, when getting the current working directory, the path is truncated.
Now in the meantime, we will skip them in Windows.
Later, I'll fix the problem and enable the tests in Windows.
Comment 11 Yusuke Suzuki 2015-09-06 20:10:41 PDT
Committed r189453: <http://trac.webkit.org/changeset/189453>