blob: d811219533a51d404963c84aa4d271932d63d95a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
/* exported a, b, c */
// SPDX-License-Identifier: MIT OR LGPL-2.0-or-later
// SPDX-FileCopyrightText: 2017 Philip Chimento <philip.chimento@gmail.com>
// Tests bindings in the global scope (var) and lexical environment (let, const)
// This should be exported as a property when importing this module:
var a = 1;
// These should not be exported, but for compatibility we will pretend they are
// for the time being:
let b = 2;
const c = 3;
// It's not clear whether this should be exported in ES6, but for compatibility
// it should be:
this.d = 4;
// Modules should have access to standard properties on the global object.
if (typeof imports === 'undefined')
throw new Error('fail the import');
// This should probably not be supported in the future, but I'm not sure how
// we can phase it out compatibly. The module should also have access to
// properties that the importing code defines.
if (typeof expectMe === 'undefined')
throw new Error('fail the import');
|