@@ -1937,39 +1937,40 @@ func TestThisWithES6Syntax(t *testing.T) {
1937
1937
Mode : config .ModeBundle ,
1938
1938
AbsOutputFile : "/out.js" ,
1939
1939
},
1940
- expectedScanLog : `es6-export-abstract-class.ts: WARNING: Top-level "this" will be replaced with undefined since this file is an ECMAScript module
1940
+ debugLogs : true ,
1941
+ expectedScanLog : `es6-export-abstract-class.ts: DEBUG: Top-level "this" will be replaced with undefined since this file is an ECMAScript module
1941
1942
es6-export-abstract-class.ts: NOTE: This file is considered to be an ECMAScript module because of the "export" keyword here:
1942
- es6-export-async-function.js: WARNING : Top-level "this" will be replaced with undefined since this file is an ECMAScript module
1943
+ es6-export-async-function.js: DEBUG : Top-level "this" will be replaced with undefined since this file is an ECMAScript module
1943
1944
es6-export-async-function.js: NOTE: This file is considered to be an ECMAScript module because of the "export" keyword here:
1944
- es6-export-class.js: WARNING : Top-level "this" will be replaced with undefined since this file is an ECMAScript module
1945
+ es6-export-class.js: DEBUG : Top-level "this" will be replaced with undefined since this file is an ECMAScript module
1945
1946
es6-export-class.js: NOTE: This file is considered to be an ECMAScript module because of the "export" keyword here:
1946
- es6-export-clause-from.js: WARNING : Top-level "this" will be replaced with undefined since this file is an ECMAScript module
1947
+ es6-export-clause-from.js: DEBUG : Top-level "this" will be replaced with undefined since this file is an ECMAScript module
1947
1948
es6-export-clause-from.js: NOTE: This file is considered to be an ECMAScript module because of the "export" keyword here:
1948
- es6-export-clause.js: WARNING : Top-level "this" will be replaced with undefined since this file is an ECMAScript module
1949
+ es6-export-clause.js: DEBUG : Top-level "this" will be replaced with undefined since this file is an ECMAScript module
1949
1950
es6-export-clause.js: NOTE: This file is considered to be an ECMAScript module because of the "export" keyword here:
1950
- es6-export-const-enum.ts: WARNING : Top-level "this" will be replaced with undefined since this file is an ECMAScript module
1951
+ es6-export-const-enum.ts: DEBUG : Top-level "this" will be replaced with undefined since this file is an ECMAScript module
1951
1952
es6-export-const-enum.ts: NOTE: This file is considered to be an ECMAScript module because of the "export" keyword here:
1952
- es6-export-default.js: WARNING : Top-level "this" will be replaced with undefined since this file is an ECMAScript module
1953
+ es6-export-default.js: DEBUG : Top-level "this" will be replaced with undefined since this file is an ECMAScript module
1953
1954
es6-export-default.js: NOTE: This file is considered to be an ECMAScript module because of the "export" keyword here:
1954
- es6-export-enum.ts: WARNING : Top-level "this" will be replaced with undefined since this file is an ECMAScript module
1955
+ es6-export-enum.ts: DEBUG : Top-level "this" will be replaced with undefined since this file is an ECMAScript module
1955
1956
es6-export-enum.ts: NOTE: This file is considered to be an ECMAScript module because of the "export" keyword here:
1956
- es6-export-function.js: WARNING : Top-level "this" will be replaced with undefined since this file is an ECMAScript module
1957
+ es6-export-function.js: DEBUG : Top-level "this" will be replaced with undefined since this file is an ECMAScript module
1957
1958
es6-export-function.js: NOTE: This file is considered to be an ECMAScript module because of the "export" keyword here:
1958
- es6-export-import-assign.ts: WARNING : Top-level "this" will be replaced with undefined since this file is an ECMAScript module
1959
+ es6-export-import-assign.ts: DEBUG : Top-level "this" will be replaced with undefined since this file is an ECMAScript module
1959
1960
es6-export-import-assign.ts: NOTE: This file is considered to be an ECMAScript module because of the "export" keyword here:
1960
- es6-export-module.ts: WARNING : Top-level "this" will be replaced with undefined since this file is an ECMAScript module
1961
+ es6-export-module.ts: DEBUG : Top-level "this" will be replaced with undefined since this file is an ECMAScript module
1961
1962
es6-export-module.ts: NOTE: This file is considered to be an ECMAScript module because of the "export" keyword here:
1962
- es6-export-namespace.ts: WARNING : Top-level "this" will be replaced with undefined since this file is an ECMAScript module
1963
+ es6-export-namespace.ts: DEBUG : Top-level "this" will be replaced with undefined since this file is an ECMAScript module
1963
1964
es6-export-namespace.ts: NOTE: This file is considered to be an ECMAScript module because of the "export" keyword here:
1964
- es6-export-star-as.js: WARNING : Top-level "this" will be replaced with undefined since this file is an ECMAScript module
1965
+ es6-export-star-as.js: DEBUG : Top-level "this" will be replaced with undefined since this file is an ECMAScript module
1965
1966
es6-export-star-as.js: NOTE: This file is considered to be an ECMAScript module because of the "export" keyword here:
1966
- es6-export-star.js: WARNING : Top-level "this" will be replaced with undefined since this file is an ECMAScript module
1967
+ es6-export-star.js: DEBUG : Top-level "this" will be replaced with undefined since this file is an ECMAScript module
1967
1968
es6-export-star.js: NOTE: This file is considered to be an ECMAScript module because of the "export" keyword here:
1968
- es6-export-variable.js: WARNING : Top-level "this" will be replaced with undefined since this file is an ECMAScript module
1969
+ es6-export-variable.js: DEBUG : Top-level "this" will be replaced with undefined since this file is an ECMAScript module
1969
1970
es6-export-variable.js: NOTE: This file is considered to be an ECMAScript module because of the "export" keyword here:
1970
- es6-expr-import-meta.js: WARNING : Top-level "this" will be replaced with undefined since this file is an ECMAScript module
1971
+ es6-expr-import-meta.js: DEBUG : Top-level "this" will be replaced with undefined since this file is an ECMAScript module
1971
1972
es6-expr-import-meta.js: NOTE: This file is considered to be an ECMAScript module because of the use of "import.meta" here:
1972
- es6-import-meta.js: WARNING : Top-level "this" will be replaced with undefined since this file is an ECMAScript module
1973
+ es6-import-meta.js: DEBUG : Top-level "this" will be replaced with undefined since this file is an ECMAScript module
1973
1974
es6-import-meta.js: NOTE: This file is considered to be an ECMAScript module because of the use of "import.meta" here:
1974
1975
` ,
1975
1976
})
@@ -5121,9 +5122,10 @@ func TestJSXThisValueESM(t *testing.T) {
5121
5122
},
5122
5123
AbsOutputDir : "/out" ,
5123
5124
},
5124
- expectedScanLog : `factory.jsx: WARNING: Top-level "this" will be replaced with undefined since this file is an ECMAScript module
5125
+ debugLogs : true ,
5126
+ expectedScanLog : `factory.jsx: DEBUG: Top-level "this" will be replaced with undefined since this file is an ECMAScript module
5125
5127
factory.jsx: NOTE: This file is considered to be an ECMAScript module because of the "export" keyword here:
5126
- fragment.jsx: WARNING : Top-level "this" will be replaced with undefined since this file is an ECMAScript module
5128
+ fragment.jsx: DEBUG : Top-level "this" will be replaced with undefined since this file is an ECMAScript module
5127
5129
fragment.jsx: NOTE: This file is considered to be an ECMAScript module because of the "export" keyword here:
5128
5130
` ,
5129
5131
})
@@ -5208,9 +5210,10 @@ func TestJSXThisPropertyESM(t *testing.T) {
5208
5210
},
5209
5211
AbsOutputDir : "/out" ,
5210
5212
},
5211
- expectedScanLog : `factory.jsx: WARNING: Top-level "this" will be replaced with undefined since this file is an ECMAScript module
5213
+ debugLogs : true ,
5214
+ expectedScanLog : `factory.jsx: DEBUG: Top-level "this" will be replaced with undefined since this file is an ECMAScript module
5212
5215
factory.jsx: NOTE: This file is considered to be an ECMAScript module because of the "export" keyword here:
5213
- fragment.jsx: WARNING : Top-level "this" will be replaced with undefined since this file is an ECMAScript module
5216
+ fragment.jsx: DEBUG : Top-level "this" will be replaced with undefined since this file is an ECMAScript module
5214
5217
fragment.jsx: NOTE: This file is considered to be an ECMAScript module because of the "export" keyword here:
5215
5218
` ,
5216
5219
})
@@ -5486,8 +5489,11 @@ func TestThisUndefinedWarningESM(t *testing.T) {
5486
5489
Mode : config .ModeBundle ,
5487
5490
AbsOutputDir : "/out" ,
5488
5491
},
5489
- expectedScanLog : `file1.js: WARNING: Top-level "this" will be replaced with undefined since this file is an ECMAScript module
5492
+ debugLogs : true ,
5493
+ expectedScanLog : `file1.js: DEBUG: Top-level "this" will be replaced with undefined since this file is an ECMAScript module
5490
5494
file1.js: NOTE: This file is considered to be an ECMAScript module because of the "export" keyword here:
5495
+ node_modules/pkg/file2.js: DEBUG: Top-level "this" will be replaced with undefined since this file is an ECMAScript module
5496
+ node_modules/pkg/file2.js: NOTE: This file is considered to be an ECMAScript module because of the "export" keyword here:
5491
5497
` ,
5492
5498
})
5493
5499
}
@@ -6736,67 +6742,6 @@ b.js: NOTE: Another definition of "x" comes from "b.js" here:
6736
6742
})
6737
6743
}
6738
6744
6739
- func TestThisIsUndefinedWarningBabelCompiledJSX (t * testing.T ) {
6740
- loader_suite .expectBundled (t , bundled {
6741
- files : map [string ]string {
6742
- "/no1.js" : `
6743
- import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
6744
- export var Foo = () => _jsxDEV("div", {}, void 0, false, { fileName: "Foo.tsx", lineNumber: 1, columnNumber: 23 }, this);
6745
- ` ,
6746
- "/no2.js" : `
6747
- import { jsxDEV } from "react/jsx-dev-runtime";
6748
- export var Foo = () => jsxDEV("div", {}, void 0, false, { fileName: "Foo.tsx", lineNumber: 1, columnNumber: 23 }, this);
6749
- ` ,
6750
-
6751
- "/yes1.js" : `
6752
- import { jsxDEV as _jsxDEV } from "react/jsx-runtime";
6753
- export var Foo = () => _jsxDEV("div", {}, void 0, false, { fileName: "Foo.tsx", lineNumber: 1, columnNumber: 23 }, this);
6754
- ` ,
6755
- "/yes2.js" : `
6756
- import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
6757
- export var Foo = () => _jsxDEV("div", {}, void 0, false, this, { fileName: "Foo.tsx", lineNumber: 1, columnNumber: 23 });
6758
- ` ,
6759
- "/yes3.js" : `
6760
- import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
6761
- export var Foo = () => _jsxDEV("div", {}, void 0, false, { fileName: "Foo.tsx", lineNumber: 1, columnNumber: 23 }, this, null);
6762
- ` ,
6763
- "/yes4.js" : `
6764
- import { _jsxDEV } from "react/jsx-dev-runtime";
6765
- export var Foo = () => _jsxDEV("div", {}, void 0, false, { fileName: "Foo.tsx", lineNumber: 1, columnNumber: 23 }, this);
6766
- ` ,
6767
-
6768
- "/node_modules/react/jsx-runtime.js" : `
6769
- export var jsxDEV
6770
- ` ,
6771
- "/node_modules/react/jsx-dev-runtime.js" : `
6772
- export var jsxDEV, _jsxDEV
6773
- ` ,
6774
- },
6775
- entryPaths : []string {
6776
- "/no1.js" ,
6777
- "/no2.js" ,
6778
-
6779
- "/yes1.js" ,
6780
- "/yes2.js" ,
6781
- "/yes3.js" ,
6782
- "/yes4.js" ,
6783
- },
6784
- options : config.Options {
6785
- Mode : config .ModeBundle ,
6786
- AbsOutputDir : "/out" ,
6787
- },
6788
- expectedScanLog : `yes1.js: WARNING: Top-level "this" will be replaced with undefined since this file is an ECMAScript module
6789
- yes1.js: NOTE: This file is considered to be an ECMAScript module because of the "export" keyword here:
6790
- yes2.js: WARNING: Top-level "this" will be replaced with undefined since this file is an ECMAScript module
6791
- yes2.js: NOTE: This file is considered to be an ECMAScript module because of the "export" keyword here:
6792
- yes3.js: WARNING: Top-level "this" will be replaced with undefined since this file is an ECMAScript module
6793
- yes3.js: NOTE: This file is considered to be an ECMAScript module because of the "export" keyword here:
6794
- yes4.js: WARNING: Top-level "this" will be replaced with undefined since this file is an ECMAScript module
6795
- yes4.js: NOTE: This file is considered to be an ECMAScript module because of the "export" keyword here:
6796
- ` ,
6797
- })
6798
- }
6799
-
6800
6745
// See: https://github.com/evanw/esbuild/issues/2537
6801
6746
func TestNonDeterminismIssue2537 (t * testing.T ) {
6802
6747
loader_suite .expectBundled (t , bundled {
0 commit comments