File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed
packages/svelte/src/compiler/phases
3-transform/client/visitors Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 22/** @import { Context } from '../types' */
33import { dev , is_ignored } from '../../../../state.js' ;
44import * as b from '#compiler/builders' ;
5- import { get_rune , UNKNOWN } from '../../../scope.js' ;
5+ import { get_rune } from '../../../scope.js' ;
66import { transform_inspect_rune } from '../../utils.js' ;
77import { should_proxy } from '../utils.js' ;
88
@@ -83,7 +83,7 @@ export function CallExpression(node, context) {
8383 node . callee . property . name
8484 ) &&
8585 node . arguments . some (
86- ( arg ) => arg . type === 'SpreadElement' || context . state . scope . evaluate ( arg ) . values . has ( UNKNOWN )
86+ ( arg ) => arg . type === 'SpreadElement' || context . state . scope . evaluate ( arg ) . has_unknown
8787 )
8888 ) {
8989 return b . call (
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ import { is_reserved, is_rune } from '../../utils.js';
1616import { determine_slot } from '../utils/slot.js' ;
1717import { validate_identifier_name } from './2-analyze/visitors/shared/utils.js' ;
1818
19- export const UNKNOWN = Symbol ( 'unknown' ) ;
19+ const UNKNOWN = Symbol ( 'unknown' ) ;
2020/** Includes `BigInt` */
2121const NUMBER = Symbol ( 'number' ) ;
2222const STRING = Symbol ( 'string' ) ;
@@ -180,6 +180,13 @@ class Evaluation {
180180 */
181181 is_known = true ;
182182
183+ /**
184+ * True if the possible values contains `UNKNOWN`
185+ * @readonly
186+ * @type {boolean }
187+ */
188+ has_unknown = false ;
189+
183190 /**
184191 * True if the value is known to not be null/undefined
185192 * @readonly
@@ -540,6 +547,10 @@ class Evaluation {
540547 if ( value == null || value === UNKNOWN ) {
541548 this . is_defined = false ;
542549 }
550+
551+ if ( value === UNKNOWN ) {
552+ this . has_unknown = true ;
553+ }
543554 }
544555
545556 if ( this . values . size > 1 || typeof this . value === 'symbol' ) {
You can’t perform that action at this time.
0 commit comments