[ES6] Namespace object re-export should be handled as local export
authorutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 May 2016 17:46:09 +0000 (17:46 +0000)
committerutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 May 2016 17:46:09 +0000 (17:46 +0000)
commit7a11ce4f180a40095dd3227330186b1fcb7ea0f1
treed2eaddf27963de19a58b662c56e29ade2f737858
parent08e5938e0b631ba6634f11aa69ded519741f0b7a
[ES6] Namespace object re-export should be handled as local export
https://bugs.webkit.org/show_bug.cgi?id=157806

Reviewed by Mark Lam.

We align the implementation of ExportEntry to the spec; remove Type::Namespace.
This Type::Namespace is used for re-exported namespace object binding. For example,

    import * as namespace from "namespace.js"
    export { namespace }

In the above case, we used ExportEntry(Type::Namespace). In this patch, we drop this
and use normal local export (Type::Local) instead because namespace object actually has
the local binding in the above module environment. And this handling strictly meets the
spec (Sec 15.2.1.16.1 step 11-a-ii-2-b).

And we also clean up the ExportEntry implementation; dropping unnecessary information.
This change fixes the test262/test/language/module-code/instn-star-equality.js crash.

* parser/ModuleAnalyzer.cpp:
(JSC::ModuleAnalyzer::exportVariable):
* runtime/JSModuleRecord.cpp:
(JSC::getExportedNames):
(JSC::JSModuleRecord::dump): Deleted.
* runtime/JSModuleRecord.h:
* tests/modules/namespace-re-export.js: Added.
* tests/modules/namespace-re-export/namespace-re-export-fixture.js: Added.
* tests/modules/namespace-re-export/namespace-re-export.js: Added.
* tests/modules/resources/assert.js:
(export.shouldNotBe):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@201085 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/parser/ModuleAnalyzer.cpp
Source/JavaScriptCore/runtime/JSModuleRecord.cpp
Source/JavaScriptCore/runtime/JSModuleRecord.h
Source/JavaScriptCore/tests/modules/namespace-re-export.js [new file with mode: 0644]
Source/JavaScriptCore/tests/modules/namespace-re-export/namespace-re-export-fixture.js [new file with mode: 0644]
Source/JavaScriptCore/tests/modules/namespace-re-export/namespace-re-export.js [new file with mode: 0644]
Source/JavaScriptCore/tests/modules/resources/assert.js