svelte 3.44.2 → 3.44.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/compiler.mjs CHANGED
@@ -19252,6 +19252,20 @@ function handle_select_value_binding(attr, dependencies) {
19252
19252
  }
19253
19253
  }
19254
19254
 
19255
+ const non_textlike_input_types = new Set([
19256
+ 'button',
19257
+ 'checkbox',
19258
+ 'color',
19259
+ 'date',
19260
+ 'datetime-local',
19261
+ 'file',
19262
+ 'hidden',
19263
+ 'image',
19264
+ 'radio',
19265
+ 'range',
19266
+ 'reset',
19267
+ 'submit'
19268
+ ]);
19255
19269
  class BaseAttributeWrapper {
19256
19270
  constructor(parent, block, node) {
19257
19271
  this.node = node;
@@ -19398,7 +19412,7 @@ class AttributeWrapper extends BaseAttributeWrapper {
19398
19412
  }
19399
19413
  if (this.is_input_value) {
19400
19414
  const type = element.node.get_static_attribute_value('type');
19401
- if (type === null || type === '' || type === 'text' || type === 'email' || type === 'password') {
19415
+ if (type !== true && !non_textlike_input_types.has(type)) {
19402
19416
  condition = x `${condition} && ${element.var}.${property_name} !== ${should_cache ? last : value}`;
19403
19417
  }
19404
19418
  }
@@ -30135,7 +30149,7 @@ class Component {
30135
30149
  if (result) {
30136
30150
  const { compile_options, name } = this;
30137
30151
  const { format = 'esm' } = compile_options;
30138
- const banner = `${this.file ? `${this.file} ` : ''}generated by Svelte v${'3.44.2'}`;
30152
+ const banner = `${this.file ? `${this.file} ` : ''}generated by Svelte v${'3.44.3'}`;
30139
30153
  const program = { type: 'Program', body: result.js };
30140
30154
  walk(program, {
30141
30155
  enter: (node, parent, key) => {
@@ -30559,11 +30573,12 @@ class Component {
30559
30573
  to_remove.unshift([parent, prop, index]);
30560
30574
  };
30561
30575
  let scope_updated = false;
30562
- let generator_count = 0;
30576
+ const current_function_stack = [];
30577
+ let current_function = null;
30563
30578
  walk(content, {
30564
30579
  enter(node, parent, prop, index) {
30565
- if ((node.type === 'FunctionDeclaration' || node.type === 'FunctionExpression') && node.generator === true) {
30566
- generator_count++;
30580
+ if ((node.type === 'FunctionDeclaration' || node.type === 'FunctionExpression')) {
30581
+ current_function_stack.push(current_function = node);
30567
30582
  }
30568
30583
  if (map.has(node)) {
30569
30584
  scope = map.get(node);
@@ -30588,11 +30603,12 @@ class Component {
30588
30603
  component.warn_on_undefined_store_value_references(node, parent, prop, scope);
30589
30604
  },
30590
30605
  leave(node) {
30591
- if ((node.type === 'FunctionDeclaration' || node.type === 'FunctionExpression') && node.generator === true) {
30592
- generator_count--;
30606
+ if ((node.type === 'FunctionDeclaration' || node.type === 'FunctionExpression')) {
30607
+ current_function_stack.pop();
30608
+ current_function = current_function_stack[current_function_stack.length - 1];
30593
30609
  }
30594
30610
  // do it on leave, to prevent infinite loop
30595
- if (component.compile_options.dev && component.compile_options.loopGuardTimeout > 0 && generator_count <= 0) {
30611
+ if (component.compile_options.dev && component.compile_options.loopGuardTimeout > 0 && (!current_function || (!current_function.generator && !current_function.async))) {
30596
30612
  const to_replace_for_loop_protect = component.loop_protect(node, scope, component.compile_options.loopGuardTimeout);
30597
30613
  if (to_replace_for_loop_protect) {
30598
30614
  this.replace(to_replace_for_loop_protect);
@@ -31624,7 +31640,7 @@ async function preprocess(source, preprocessor, options) {
31624
31640
  return result.to_processed();
31625
31641
  }
31626
31642
 
31627
- const VERSION = '3.44.2';
31643
+ const VERSION = '3.44.3';
31628
31644
 
31629
31645
  export { VERSION, compile, parse$3 as parse, preprocess, walk };
31630
31646
  //# sourceMappingURL=compiler.mjs.map