Apply suggestions from code review

Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
pull/15494/head
Rich Harris 1 year ago committed by GitHub
parent 696bb2e8bd
commit 7d697d9889
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -2,4 +2,4 @@
'svelte': minor
---
feat: partial evaluation
feat: partially evaluate certain expressions

@ -686,7 +686,6 @@ function build_element_special_value_attribute(element, node_id, attribute, cont
);
const evaluated = context.state.scope.evaluate(value);
const assignment = b.assignment('=', b.member(node_id, '__value'), value);
const inner_assignment = b.assignment(

@ -17,7 +17,8 @@ import { determine_slot } from '../utils/slot.js';
import { validate_identifier_name } from './2-analyze/visitors/shared/utils.js';
export const UNKNOWN = Symbol('unknown');
export const NUMBER = Symbol('number'); // includes BigInt
/** Includes `BigInt` */
export const NUMBER = Symbol('number');
export const STRING = Symbol('string');
export class Binding {
@ -540,7 +541,9 @@ export class Scope {
}
/**
*
* Does partial evaluation to find an exact value or at least the rough type of the expression.
* Only call this once scope has been fully generated in a first pass,
* else this evaluates on incomplete data and may yield wrong results.
* @param {Expression} expression
* @param {Set<any>} values
*/

Loading…
Cancel
Save