Skip to content

Commit

Permalink
babel8 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
liuxingbaoyu committed Sep 27, 2022
1 parent 555ac90 commit 7a1ec26
Show file tree
Hide file tree
Showing 17 changed files with 34 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,15 @@ declare let sub_invariant: Invariant<string>;
super_invariant = sub_invariant; // Error

sub_invariant = super_invariant; // Error

// Variance of various type constructors

type T10<out T> = T;
type T11<in T> = keyof T;
type T12<out T, out K extends keyof T> = T[K];
type T13<in out T> = T[keyof T]; // Variance annotation errors
type T13<in out T> = T[keyof T];

// Variance annotation errors

type Covariant1<in T> = {
// Error
Expand All @@ -48,7 +51,9 @@ type Invariant1<in T> = {
type Invariant2<out T> = {
// Error
f: (x: T) => T;
}; // Variance in circular types
};

// Variance in circular types

type Foo1<in T> = {
// Error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ new Promise(); // new builtin
Symbol.match; // as member expression

_arr[Symbol.iterator](); // Symbol.iterator

// no import


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ var assignStr = "assign";
var entriesStr = "entries";
var valuesStr = "values";
var inclidesStr = "includes";
var findStr = "find"; // Allow static methods be assigned to variables only directly in the module.
var findStr = "find";

// Allow static methods be assigned to variables only directly in the module.

externalVar[valuesStr]; // don't include

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import "core-js/modules/es7.array.includes.js";
import "core-js/modules/es6.array.find.js";
var arrayInstance = [];
var inclidesStr = "includes";
var findStr = "find"; // Allow instance methods be assigned to variables.
var findStr = "find";

// Allow instance methods be assigned to variables.

arrayInstance[inclidesStr](); // include

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import "core-js/modules/web.dom.iterable.js";
Array.from; // static function

Map; // top level built-in

// instance methods may have false positives (which is ok)

a.includes(); // method call
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import "core-js/modules/es6.regexp.split.js";
Array.from; // static function

Map; // top level built-in

// instance methods may have false positives (which is ok)

a.includes(); // method call
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Map; // built-in
new Promise(); // new builtin

Symbol.match; // as member expression

// no import

Array.asdf;
Expand All @@ -24,6 +25,7 @@ G.assign; // static method
function H(WeakMap) {
var blah = new WeakMap();
} // shadowed

// not covered by this plugin


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ new Promise(); // new builtin
Symbol.match; // as member expression

_arr[Symbol.iterator](); // Symbol.iterator

// no import


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ new Promise(); // new builtin
Symbol.match; // as member expression

_arr[Symbol.iterator](); // Symbol.iterator

// no import


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ new Promise(); // new builtin
Symbol.match; // as member expression

_arr[Symbol.iterator](); // Symbol.iterator

// no import


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ var assignStr = "assign";
var entriesStr = "entries";
var valuesStr = "values";
var inclidesStr = "includes";
var findStr = "find"; // Allow static methods be assigned to variables only directly in the module.
var findStr = "find";

// Allow static methods be assigned to variables only directly in the module.

externalVar[valuesStr]; // don't include

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import "core-js/modules/es.array.includes.js";
var arrayInstance = [];
var inclidesStr = "includes";
var findStr = "find"; // Allow instance methods be assigned to variables.
var findStr = "find";

// Allow instance methods be assigned to variables.

arrayInstance[inclidesStr](); // include

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Array.from; // static function

Map; // top level built-in

// instance methods may have false positives (which is ok)

a.includes(); // method call
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import "core-js/modules/es.string.split.js";
Array.from; // static function

Map; // top level built-in

// instance methods may have false positives (which is ok)

a.includes(); // method call
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Map; // built-in
new Promise(); // new builtin

Symbol.match; // as member expression

// no import

Array.asdf;
Expand All @@ -23,6 +24,7 @@ G.assign; // static method
function H(WeakMap) {
var blah = new WeakMap();
} // shadowed

// not covered by this plugin


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ new Promise(); // new builtin
Symbol.match; // as member expression

_arr[Symbol.iterator](); // Symbol.iterator

// no import


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ new Promise(); // new builtin
Symbol.match; // as member expression

_arr[Symbol.iterator](); // Symbol.iterator

// no import


Expand All @@ -26,6 +27,7 @@ G.assign; // static method
function H(WeakMap) {
var blah = new WeakMap();
} // shadowed

// not covered by this plugin


Expand Down

0 comments on commit 7a1ec26

Please sign in to comment.