dillon1000/react

Commit

Console methods are readonly

Defines common `console` methods to tell the compiler that they take readonly 
args. This ensures that things like `console.log()` aren't accidentally viewed 
as a mutation. Previously the pattern of "build object, then log it after 
mutation is done" would have grouped the console.log as part of the mutation and 
the log only would fire if the value got reconstructed. Now we know the log 
isn't mutating, and the log will happen regardless of whether the value is 
rebuilt or cached.
Browse files
Changed paths6 files
First-parent comparison
M compiler/forget/src/HIR/Globals.ts ModifiedA compiler/forget/src/__tests__/fixtures/compiler/console-readonly.expect.md AddedA compiler/forget/src/__tests__/fixtures/compiler/console-readonly.js AddedM compiler/forget/src/__tests__/fixtures/compiler/ssa-renaming-ternary-destruction.expect.md ModifiedM compiler/forget/src/__tests__/fixtures/compiler/ssa-renaming-ternary.expect.md ModifiedM compiler/forget/src/__tests__/fixtures/compiler/ssa-renaming-unconditional-ternary.expect.md Modified
Patch

Files changed

Rendering syntax-highlighted changes…