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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Svelte changelog
2
2
 
3
+ ## 3.44.3
4
+
5
+ * Fix `bind:this` binding inside `onMount` for manually instantiated component ([#6760](https://github.com/sveltejs/svelte/issues/6760))
6
+ * Prevent cursor jumps for other `type="text"`-like `<input>`s ([#6914](https://github.com/sveltejs/svelte/issues/6914))
7
+ * Exclude `async` loops from `loopGuardTimeout` ([#6945](https://github.com/sveltejs/svelte/issues/6945))
8
+
3
9
  ## 3.44.2
4
10
 
5
11
  * Fix overly restrictive preprocessor types ([#6904](https://github.com/sveltejs/svelte/pull/6904))
package/compiler.js CHANGED
@@ -19258,6 +19258,20 @@
19258
19258
  }
19259
19259
  }
19260
19260
 
19261
+ const non_textlike_input_types = new Set([
19262
+ 'button',
19263
+ 'checkbox',
19264
+ 'color',
19265
+ 'date',
19266
+ 'datetime-local',
19267
+ 'file',
19268
+ 'hidden',
19269
+ 'image',
19270
+ 'radio',
19271
+ 'range',
19272
+ 'reset',
19273
+ 'submit'
19274
+ ]);
19261
19275
  class BaseAttributeWrapper {
19262
19276
  constructor(parent, block, node) {
19263
19277
  this.node = node;
@@ -19404,7 +19418,7 @@
19404
19418
  }
19405
19419
  if (this.is_input_value) {
19406
19420
  const type = element.node.get_static_attribute_value('type');
19407
- if (type === null || type === '' || type === 'text' || type === 'email' || type === 'password') {
19421
+ if (type !== true && !non_textlike_input_types.has(type)) {
19408
19422
  condition = x `${condition} && ${element.var}.${property_name} !== ${should_cache ? last : value}`;
19409
19423
  }
19410
19424
  }
@@ -30141,7 +30155,7 @@
30141
30155
  if (result) {
30142
30156
  const { compile_options, name } = this;
30143
30157
  const { format = 'esm' } = compile_options;
30144
- const banner = `${this.file ? `${this.file} ` : ''}generated by Svelte v${'3.44.2'}`;
30158
+ const banner = `${this.file ? `${this.file} ` : ''}generated by Svelte v${'3.44.3'}`;
30145
30159
  const program = { type: 'Program', body: result.js };
30146
30160
  walk(program, {
30147
30161
  enter: (node, parent, key) => {
@@ -30565,11 +30579,12 @@
30565
30579
  to_remove.unshift([parent, prop, index]);
30566
30580
  };
30567
30581
  let scope_updated = false;
30568
- let generator_count = 0;
30582
+ const current_function_stack = [];
30583
+ let current_function = null;
30569
30584
  walk(content, {
30570
30585
  enter(node, parent, prop, index) {
30571
- if ((node.type === 'FunctionDeclaration' || node.type === 'FunctionExpression') && node.generator === true) {
30572
- generator_count++;
30586
+ if ((node.type === 'FunctionDeclaration' || node.type === 'FunctionExpression')) {
30587
+ current_function_stack.push(current_function = node);
30573
30588
  }
30574
30589
  if (map.has(node)) {
30575
30590
  scope = map.get(node);
@@ -30594,11 +30609,12 @@
30594
30609
  component.warn_on_undefined_store_value_references(node, parent, prop, scope);
30595
30610
  },
30596
30611
  leave(node) {
30597
- if ((node.type === 'FunctionDeclaration' || node.type === 'FunctionExpression') && node.generator === true) {
30598
- generator_count--;
30612
+ if ((node.type === 'FunctionDeclaration' || node.type === 'FunctionExpression')) {
30613
+ current_function_stack.pop();
30614
+ current_function = current_function_stack[current_function_stack.length - 1];
30599
30615
  }
30600
30616
  // do it on leave, to prevent infinite loop
30601
- if (component.compile_options.dev && component.compile_options.loopGuardTimeout > 0 && generator_count <= 0) {
30617
+ if (component.compile_options.dev && component.compile_options.loopGuardTimeout > 0 && (!current_function || (!current_function.generator && !current_function.async))) {
30602
30618
  const to_replace_for_loop_protect = component.loop_protect(node, scope, component.compile_options.loopGuardTimeout);
30603
30619
  if (to_replace_for_loop_protect) {
30604
30620
  this.replace(to_replace_for_loop_protect);
@@ -31630,7 +31646,7 @@
31630
31646
  return result.to_processed();
31631
31647
  }
31632
31648
 
31633
- const VERSION = '3.44.2';
31649
+ const VERSION = '3.44.3';
31634
31650
 
31635
31651
  exports.VERSION = VERSION;
31636
31652
  exports.compile = compile;