|
19 | 19 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
20 | 20 | // USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21 | 21 |
|
| 22 | +// This test cannot run in strict mode because it tests that `baseFoo` is |
| 23 | +// treated as a global without being declared with `var`/`let`/`const`. |
| 24 | + |
22 | 25 | /* eslint-disable strict */
|
23 | 26 | const common = require('../common');
|
24 |
| -const path = require('path'); |
| 27 | + |
25 | 28 | const assert = require('assert');
|
| 29 | +const path = require('path'); |
26 | 30 |
|
27 | 31 | common.globalCheck = false;
|
28 | 32 |
|
29 | 33 | baseFoo = 'foo'; // eslint-disable-line no-undef
|
30 | 34 | global.baseBar = 'bar';
|
31 | 35 |
|
32 |
| -assert.strictEqual('foo', global.baseFoo, |
| 36 | +assert.strictEqual(global.baseFoo, 'foo', |
33 | 37 | 'x -> global.x in base level not working');
|
34 | 38 |
|
35 |
| -assert.strictEqual('bar', |
36 |
| - baseBar, // eslint-disable-line no-undef |
| 39 | +assert.strictEqual(baseBar, // eslint-disable-line no-undef |
| 40 | + 'bar', |
37 | 41 | 'global.x -> x in base level not working');
|
38 | 42 |
|
39 | 43 | const mod = require(path.join(common.fixturesDir, 'global', 'plain'));
|
40 | 44 | const fooBar = mod.fooBar;
|
41 | 45 |
|
42 |
| -assert.strictEqual('foo', fooBar.foo, 'x -> global.x in sub level not working'); |
| 46 | +assert.strictEqual(fooBar.foo, 'foo', 'x -> global.x in sub level not working'); |
43 | 47 |
|
44 |
| -assert.strictEqual('bar', fooBar.bar, 'global.x -> x in sub level not working'); |
| 48 | +assert.strictEqual(fooBar.bar, 'bar', 'global.x -> x in sub level not working'); |
45 | 49 |
|
46 | 50 | assert.strictEqual(Object.prototype.toString.call(global), '[object global]');
|
0 commit comments