fix(compiler): use globalThis.Symbol to prevent shadowing by user components #39
Annotations
10 errors and 1 notice
|
compiler/apps/playground/__tests__/e2e/page.spec.ts#L372
3) [chromium] › __tests__/e2e/page.spec.ts:348:7 › playground compiles: compilationMode-all ──────
Retry #1 ───────────────────────────────────────────────────────────────────────────────────────
Error: expect(string).toMatchSnapshot(expected) failed
@@ -1,10 +1,10 @@
import { c as _c } from "react/compiler-runtime"; // @compilationMode:"all"
function nonReactFn() {
const $ = _c(1);
let t0;
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
+ if ($[0] === globalThis.Symbol.for("react.memo_cache_sentinel")) {
t0 = {};
$[0] = t0;
} else {
t0 = $[0];
}
Snapshot: compilationMode-all-output.txt
370 |
371 | expect(output).not.toEqual('');
> 372 | expect(output).toMatchSnapshot(`${t.name}-output.txt`);
| ^
373 | }),
374 | );
375 |
at /home/runner/work/react-mirror/react-mirror/compiler/apps/playground/__tests__/e2e/page.spec.ts:372:20
|
|
compiler/apps/playground/__tests__/e2e/page.spec.ts#L372
3) [chromium] › __tests__/e2e/page.spec.ts:348:7 › playground compiles: compilationMode-all ──────
Error: expect(string).toMatchSnapshot(expected) failed
@@ -1,10 +1,10 @@
import { c as _c } from "react/compiler-runtime"; // @compilationMode:"all"
function nonReactFn() {
const $ = _c(1);
let t0;
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
+ if ($[0] === globalThis.Symbol.for("react.memo_cache_sentinel")) {
t0 = {};
$[0] = t0;
} else {
t0 = $[0];
}
Snapshot: compilationMode-all-output.txt
370 |
371 | expect(output).not.toEqual('');
> 372 | expect(output).toMatchSnapshot(`${t.name}-output.txt`);
| ^
373 | }),
374 | );
375 |
at /home/runner/work/react-mirror/react-mirror/compiler/apps/playground/__tests__/e2e/page.spec.ts:372:20
|
|
compiler/apps/playground/__tests__/e2e/page.spec.ts#L372
2) [chromium] › __tests__/e2e/page.spec.ts:348:7 › playground compiles: parse-typescript ─────────
Retry #3 ───────────────────────────────────────────────────────────────────────────────────────
Error: expect(string).toMatchSnapshot(expected) failed
@@ -1,18 +1,18 @@
import { c as _c } from "react/compiler-runtime";
function Foo() {
const $ = _c(2);
let t0;
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
+ if ($[0] === globalThis.Symbol.for("react.memo_cache_sentinel")) {
t0 = foo();
$[0] = t0;
} else {
t0 = $[0];
}
const x = t0 as number;
let t1;
- if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
+ if ($[1] === globalThis.Symbol.for("react.memo_cache_sentinel")) {
t1 = <div>{x}</div>;
$[1] = t1;
} else {
t1 = $[1];
}
Snapshot: parse-typescript-output.txt
370 |
371 | expect(output).not.toEqual('');
> 372 | expect(output).toMatchSnapshot(`${t.name}-output.txt`);
| ^
373 | }),
374 | );
375 |
at /home/runner/work/react-mirror/react-mirror/compiler/apps/playground/__tests__/e2e/page.spec.ts:372:20
|
|
compiler/apps/playground/__tests__/e2e/page.spec.ts#L372
2) [chromium] › __tests__/e2e/page.spec.ts:348:7 › playground compiles: parse-typescript ─────────
Retry #2 ───────────────────────────────────────────────────────────────────────────────────────
Error: expect(string).toMatchSnapshot(expected) failed
@@ -1,18 +1,18 @@
import { c as _c } from "react/compiler-runtime";
function Foo() {
const $ = _c(2);
let t0;
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
+ if ($[0] === globalThis.Symbol.for("react.memo_cache_sentinel")) {
t0 = foo();
$[0] = t0;
} else {
t0 = $[0];
}
const x = t0 as number;
let t1;
- if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
+ if ($[1] === globalThis.Symbol.for("react.memo_cache_sentinel")) {
t1 = <div>{x}</div>;
$[1] = t1;
} else {
t1 = $[1];
}
Snapshot: parse-typescript-output.txt
370 |
371 | expect(output).not.toEqual('');
> 372 | expect(output).toMatchSnapshot(`${t.name}-output.txt`);
| ^
373 | }),
374 | );
375 |
at /home/runner/work/react-mirror/react-mirror/compiler/apps/playground/__tests__/e2e/page.spec.ts:372:20
|
|
compiler/apps/playground/__tests__/e2e/page.spec.ts#L372
2) [chromium] › __tests__/e2e/page.spec.ts:348:7 › playground compiles: parse-typescript ─────────
Retry #1 ───────────────────────────────────────────────────────────────────────────────────────
Error: expect(string).toMatchSnapshot(expected) failed
@@ -1,18 +1,18 @@
import { c as _c } from "react/compiler-runtime";
function Foo() {
const $ = _c(2);
let t0;
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
+ if ($[0] === globalThis.Symbol.for("react.memo_cache_sentinel")) {
t0 = foo();
$[0] = t0;
} else {
t0 = $[0];
}
const x = t0 as number;
let t1;
- if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
+ if ($[1] === globalThis.Symbol.for("react.memo_cache_sentinel")) {
t1 = <div>{x}</div>;
$[1] = t1;
} else {
t1 = $[1];
}
Snapshot: parse-typescript-output.txt
370 |
371 | expect(output).not.toEqual('');
> 372 | expect(output).toMatchSnapshot(`${t.name}-output.txt`);
| ^
373 | }),
374 | );
375 |
at /home/runner/work/react-mirror/react-mirror/compiler/apps/playground/__tests__/e2e/page.spec.ts:372:20
|
|
compiler/apps/playground/__tests__/e2e/page.spec.ts#L372
2) [chromium] › __tests__/e2e/page.spec.ts:348:7 › playground compiles: parse-typescript ─────────
Error: expect(string).toMatchSnapshot(expected) failed
@@ -1,18 +1,18 @@
import { c as _c } from "react/compiler-runtime";
function Foo() {
const $ = _c(2);
let t0;
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
+ if ($[0] === globalThis.Symbol.for("react.memo_cache_sentinel")) {
t0 = foo();
$[0] = t0;
} else {
t0 = $[0];
}
const x = t0 as number;
let t1;
- if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
+ if ($[1] === globalThis.Symbol.for("react.memo_cache_sentinel")) {
t1 = <div>{x}</div>;
$[1] = t1;
} else {
t1 = $[1];
}
Snapshot: parse-typescript-output.txt
370 |
371 | expect(output).not.toEqual('');
> 372 | expect(output).toMatchSnapshot(`${t.name}-output.txt`);
| ^
373 | }),
374 | );
375 |
at /home/runner/work/react-mirror/react-mirror/compiler/apps/playground/__tests__/e2e/page.spec.ts:372:20
|
|
compiler/apps/playground/__tests__/e2e/page.spec.ts#L184
1) [chromium] › __tests__/e2e/page.spec.ts:156:5 › reset button works ────────────────────────────
Retry #3 ───────────────────────────────────────────────────────────────────────────────────────
Error: expect(string).toMatchSnapshot(expected) failed
@@ -1,10 +1,10 @@
import { c as _c } from "react/compiler-runtime";
export default function MyApp() {
const $ = _c(1);
let t0;
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
+ if ($[0] === globalThis.Symbol.for("react.memo_cache_sentinel")) {
t0 = <div>Hello World</div>;
$[0] = t0;
} else {
t0 = $[0];
}
Snapshot: 02-default-output.txt
182 |
183 | expect(output).not.toEqual('');
> 184 | expect(output).toMatchSnapshot('02-default-output.txt');
| ^
185 | expect(configOutput).not.toEqual('');
186 | expect(configOutput).toMatchSnapshot('default-config.txt');
187 | });
at /home/runner/work/react-mirror/react-mirror/compiler/apps/playground/__tests__/e2e/page.spec.ts:184:18
|
|
compiler/apps/playground/__tests__/e2e/page.spec.ts#L184
1) [chromium] › __tests__/e2e/page.spec.ts:156:5 › reset button works ────────────────────────────
Retry #2 ───────────────────────────────────────────────────────────────────────────────────────
Error: expect(string).toMatchSnapshot(expected) failed
@@ -1,10 +1,10 @@
import { c as _c } from "react/compiler-runtime";
export default function MyApp() {
const $ = _c(1);
let t0;
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
+ if ($[0] === globalThis.Symbol.for("react.memo_cache_sentinel")) {
t0 = <div>Hello World</div>;
$[0] = t0;
} else {
t0 = $[0];
}
Snapshot: 02-default-output.txt
182 |
183 | expect(output).not.toEqual('');
> 184 | expect(output).toMatchSnapshot('02-default-output.txt');
| ^
185 | expect(configOutput).not.toEqual('');
186 | expect(configOutput).toMatchSnapshot('default-config.txt');
187 | });
at /home/runner/work/react-mirror/react-mirror/compiler/apps/playground/__tests__/e2e/page.spec.ts:184:18
|
|
compiler/apps/playground/__tests__/e2e/page.spec.ts#L184
1) [chromium] › __tests__/e2e/page.spec.ts:156:5 › reset button works ────────────────────────────
Retry #1 ───────────────────────────────────────────────────────────────────────────────────────
Error: expect(string).toMatchSnapshot(expected) failed
@@ -1,10 +1,10 @@
import { c as _c } from "react/compiler-runtime";
export default function MyApp() {
const $ = _c(1);
let t0;
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
+ if ($[0] === globalThis.Symbol.for("react.memo_cache_sentinel")) {
t0 = <div>Hello World</div>;
$[0] = t0;
} else {
t0 = $[0];
}
Snapshot: 02-default-output.txt
182 |
183 | expect(output).not.toEqual('');
> 184 | expect(output).toMatchSnapshot('02-default-output.txt');
| ^
185 | expect(configOutput).not.toEqual('');
186 | expect(configOutput).toMatchSnapshot('default-config.txt');
187 | });
at /home/runner/work/react-mirror/react-mirror/compiler/apps/playground/__tests__/e2e/page.spec.ts:184:18
|
|
compiler/apps/playground/__tests__/e2e/page.spec.ts#L184
1) [chromium] › __tests__/e2e/page.spec.ts:156:5 › reset button works ────────────────────────────
Error: expect(string).toMatchSnapshot(expected) failed
@@ -1,10 +1,10 @@
import { c as _c } from "react/compiler-runtime";
export default function MyApp() {
const $ = _c(1);
let t0;
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
+ if ($[0] === globalThis.Symbol.for("react.memo_cache_sentinel")) {
t0 = <div>Hello World</div>;
$[0] = t0;
} else {
t0 = $[0];
}
Snapshot: 02-default-output.txt
182 |
183 | expect(output).not.toEqual('');
> 184 | expect(output).toMatchSnapshot('02-default-output.txt');
| ^
185 | expect(configOutput).not.toEqual('');
186 | expect(configOutput).toMatchSnapshot('default-config.txt');
187 | });
at /home/runner/work/react-mirror/react-mirror/compiler/apps/playground/__tests__/e2e/page.spec.ts:184:18
|
|
3 failed
[chromium] › __tests__/e2e/page.spec.ts:156:5 › reset button works ─────────────────────────────
[chromium] › __tests__/e2e/page.spec.ts:348:7 › playground compiles: parse-typescript ──────────
[chromium] › __tests__/e2e/page.spec.ts:348:7 › playground compiles: compilationMode-all ───────
15 passed (2.5m)
|
The logs for this run have expired and are no longer available.
Loading