Skip to content

Commit

Permalink
export-ns: WIP success cases for 'import *' of module with 'export * …
Browse files Browse the repository at this point in the history
…(as ns)'
  • Loading branch information
Valerie R Young committed Mar 16, 2018
1 parent f45184c commit 5ed0b9e
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 1 deletion.
2 changes: 2 additions & 0 deletions test/language/module-code/instn-star-props-nrml-1_FIXTURE.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ export { indirectIdName } from './instn-star-props-nrml-indirect_FIXTURE.js';
export { indirectIdName as indirectIdName2 } from './instn-star-props-nrml-indirect_FIXTURE.js';

export * from './instn-star-props-nrml-star_FIXTURE.js';

export * as exportns from './instn-star-props-nrml-star-as-exportns_FIXTURE.js';
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright (C) 2018 Valerie Young. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

var notExportedVar3;
let notExportedLet3;
const notExportedConst3 = null;
function notExportedFunc3() {}
function* notExportedGen3() {}
class notExportedClass3 {}

var starBindingId;

export var starAsVarDecl;
export let starAsLetDecl;
export const starAsConstDecl = null;
export function starAsFuncDecl() {}
export function* starAsGenDecl() {}
export class starAsClassDecl {}
export { starAsBindingId };
export { starAsBindingId as starIdName };
export { starAsIndirectIdName } from './instn-star-props-nrml-indirect_FIXTURE.js';
export { starAsIndirectIdName as starAsIndirectIdName2 } from './instn-star-props-nrml-indirect_FIXTURE.js';
20 changes: 19 additions & 1 deletion test/language/module-code/instn-star-props-nrml.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,34 @@ assert('starIdName' in ns, 'starIdName');
assert('starIndirectIdName' in ns, 'starIndirectIdName');
assert('starIndirectIdName2' in ns, 'starIndirectIdName2');

// Bindings that were not exported from either module
// Export entries defined by a re-exported as exportns module
assert('starAsVarDecl' in ns.exportns, 'starssVarDecl');
assert('starAsLetDecl' in ns.exportns, 'starSsLetDecl');
assert('starAsConstDecl' in ns.exportns, 'starSsConstDecl');
assert('starAsFuncDecl' in ns.exportns, 'starAsFuncDecl');
assert('starAsGenDecl' in ns.exportns, 'starAsGenDecl');
assert('starAsClassDecl' in ns.exportns, 'starAsClassDecl');
assert('starAsBindingId' in ns.exportns, 'starAsBindingId');
assert('starAsIdName' in ns.exportns, 'starAsIdName');
assert('starAsIndirectIdName' in ns.exportns, 'starAsIndirectIdName');
assert('starAsIndirectIdName2' in ns.exportns, 'starAsIndirectIdName2');

// Bindings that were not exported from any module
assert.sameValue('nonExportedVar1' in ns, false, 'nonExportedVar1');
assert.sameValue('nonExportedVar2' in ns, false, 'nonExportedVar2');
assert.sameValue('nonExportedVar3' in ns.exportns, false, 'nonExportedVar3');
assert.sameValue('nonExportedLet1' in ns, false, 'nonExportedLet1');
assert.sameValue('nonExportedLet2' in ns, false, 'nonExportedLet2');
assert.sameValue('nonExportedLet3' in ns.exportns, false, 'nonExportedLet3');
assert.sameValue('nonExportedConst1' in ns, false, 'nonExportedConst1');
assert.sameValue('nonExportedConst2' in ns, false, 'nonExportedConst2');
assert.sameValue('nonExportedConst3' in ns.exportns, false, 'nonExportedConst3');
assert.sameValue('nonExportedFunc1' in ns, false, 'nonExportedFunc1');
assert.sameValue('nonExportedFunc2' in ns, false, 'nonExportedFunc2');
assert.sameValue('nonExportedFunc3' in ns.exportns, false, 'nonExportedFunc3');
assert.sameValue('nonExportedGen1' in ns, false, 'nonExportedGen1');
assert.sameValue('nonExportedGen2' in ns, false, 'nonExportedGen2');
assert.sameValue('nonExportedGen3' in ns.exportns, false, 'nonExportedGen3');
assert.sameValue('nonExportedClass1' in ns, false, 'nonExportedClass1');
assert.sameValue('nonExportedClass2' in ns, false, 'nonExportedClass2');
assert.sameValue('nonExportedClass3' in ns.exportns, false, 'nonExportedClass3');

0 comments on commit 5ed0b9e

Please sign in to comment.