mirror of https://github.com/sveltejs/svelte
fix: ensure inline object literals are correctly serialised (#14325)
* fix: ensure inline object literals are correctly serialised * Apply suggestions from code review * address feedback * address feedback --------- Co-authored-by: Rich Harris <rich.harris@vercel.com>pull/14328/head
parent
95ab85fad7
commit
3a69b4c415
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'svelte': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix: treat property accesses of literals as pure
|
@ -0,0 +1,11 @@
|
|||||||
|
import { test } from '../../test';
|
||||||
|
|
||||||
|
export default test({
|
||||||
|
html: `
|
||||||
|
<p>Without text expression: 7.36</p>
|
||||||
|
<p>With text expression: 7.36</p>
|
||||||
|
<p>With text expression and function call: 7.36</p>
|
||||||
|
<p>With text expression and property access: 4</p>
|
||||||
|
<h1>Hello name!</h1>
|
||||||
|
<p>4</p>`
|
||||||
|
});
|
@ -0,0 +1,6 @@
|
|||||||
|
<p>Without text expression: 7.36</p>
|
||||||
|
<p>With text expression: {7.36}</p>
|
||||||
|
<p>With text expression and function call: {(7.36).toLocaleString()}</p>
|
||||||
|
<p>With text expression and property access: {"test".length}</p>
|
||||||
|
<h1>Hello {('name').toUpperCase().toLowerCase()}!</h1>
|
||||||
|
<p>{"test".length}</p>
|
Loading…
Reference in new issue