[modules] Add tests for empty imports.
R=adamk@chromium.org BUG=v8:1569 Review-Url: https://codereview.chromium.org/2369133002 Cr-Commit-Position: refs/heads/master@{#39739}
This commit is contained in:
parent
550e37296c
commit
0614eb5471
9
test/mjsunit/modules-empty-import1.js
Normal file
9
test/mjsunit/modules-empty-import1.js
Normal file
@ -0,0 +1,9 @@
|
||||
// Copyright 2016 the V8 project authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
//
|
||||
// MODULE
|
||||
|
||||
import "modules-skip-empty-import.js";
|
||||
import {counter} from "modules-skip-empty-import-aux.js";
|
||||
assertEquals(1, counter);
|
9
test/mjsunit/modules-empty-import2.js
Normal file
9
test/mjsunit/modules-empty-import2.js
Normal file
@ -0,0 +1,9 @@
|
||||
// Copyright 2016 the V8 project authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
//
|
||||
// MODULE
|
||||
|
||||
import {} from "modules-skip-empty-import.js";
|
||||
import {counter} from "modules-skip-empty-import-aux.js";
|
||||
assertEquals(1, counter);
|
9
test/mjsunit/modules-empty-import3.js
Normal file
9
test/mjsunit/modules-empty-import3.js
Normal file
@ -0,0 +1,9 @@
|
||||
// Copyright 2016 the V8 project authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
//
|
||||
// MODULE
|
||||
|
||||
export {} from "modules-skip-empty-import.js";
|
||||
import {counter} from "modules-skip-empty-import-aux.js";
|
||||
assertEquals(1, counter);
|
11
test/mjsunit/modules-empty-import4.js
Normal file
11
test/mjsunit/modules-empty-import4.js
Normal file
@ -0,0 +1,11 @@
|
||||
// Copyright 2016 the V8 project authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
//
|
||||
// MODULE
|
||||
|
||||
import "modules-skip-empty-import.js";
|
||||
import {} from "modules-skip-empty-import.js";
|
||||
export {} from "modules-skip-empty-import.js";
|
||||
import {counter} from "modules-skip-empty-import-aux.js";
|
||||
assertEquals(1, counter);
|
6
test/mjsunit/modules-skip-empty-import-aux.js
Normal file
6
test/mjsunit/modules-skip-empty-import-aux.js
Normal file
@ -0,0 +1,6 @@
|
||||
// Copyright 2016 the V8 project authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
export let counter = 0;
|
||||
export function incr() { counter++ };
|
6
test/mjsunit/modules-skip-empty-import.js
Normal file
6
test/mjsunit/modules-skip-empty-import.js
Normal file
@ -0,0 +1,6 @@
|
||||
// Copyright 2016 the V8 project authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import {incr} from "modules-skip-empty-import-aux.js";
|
||||
incr();
|
Loading…
Reference in New Issue
Block a user