Comparing version 2.4.1 to 2.4.2
# Svelte changelog | ||
## 2.4.2 | ||
* Evaluate `each` key in child scope ([#1397](https://github.com/sveltejs/svelte/issues/1397)) | ||
* Prevent false negatives and positives when detecting cyclical computed store properties ([#1399](https://github.com/sveltejs/svelte/issues/1399)) | ||
* Only update dynamic component props ([#1394](https://github.com/sveltejs/svelte/issues/1394)) | ||
## 2.4.1 | ||
@@ -4,0 +10,0 @@ |
@@ -533,3 +533,3 @@ 'use strict'; | ||
var version = "2.4.1"; | ||
var version = "2.4.2"; | ||
@@ -536,0 +536,0 @@ const prog = lib$2('svelte').version(version); |
{ | ||
"name": "svelte", | ||
"version": "2.4.1", | ||
"version": "2.4.2", | ||
"description": "The magical disappearing UI framework", | ||
@@ -5,0 +5,0 @@ "main": "compiler/svelte.js", |
27
store.js
@@ -52,19 +52,21 @@ import { | ||
var sorted = this._sortedComputedProperties = []; | ||
var cycles; | ||
var visited = blankObject(); | ||
var currentKey; | ||
function visit(key) { | ||
if (cycles[key]) { | ||
throw new Error('Cyclical dependency detected'); | ||
} | ||
var c = computed[key]; | ||
if (visited[key]) return; | ||
visited[key] = true; | ||
if (c) { | ||
c.deps.forEach(dep => { | ||
if (dep === currentKey) { | ||
throw new Error(`Cyclical dependency detected between ${dep} <-> ${key}`); | ||
} | ||
var c = computed[key]; | ||
visit(dep); | ||
}); | ||
if (c) { | ||
cycles[key] = true; | ||
c.deps.forEach(visit); | ||
sorted.push(c); | ||
if (!visited[key]) { | ||
visited[key] = true; | ||
sorted.push(c); | ||
} | ||
} | ||
@@ -74,4 +76,3 @@ } | ||
for (var key in this._computed) { | ||
cycles = blankObject(); | ||
visit(key); | ||
visit(currentKey = key); | ||
} | ||
@@ -78,0 +79,0 @@ }, |
@@ -97,19 +97,21 @@ (function (global, factory) { | ||
var sorted = this._sortedComputedProperties = []; | ||
var cycles; | ||
var visited = blankObject(); | ||
var currentKey; | ||
function visit(key) { | ||
if (cycles[key]) { | ||
throw new Error('Cyclical dependency detected'); | ||
} | ||
var c = computed[key]; | ||
if (visited[key]) return; | ||
visited[key] = true; | ||
if (c) { | ||
c.deps.forEach(dep => { | ||
if (dep === currentKey) { | ||
throw new Error(`Cyclical dependency detected between ${dep} <-> ${key}`); | ||
} | ||
var c = computed[key]; | ||
visit(dep); | ||
}); | ||
if (c) { | ||
cycles[key] = true; | ||
c.deps.forEach(visit); | ||
sorted.push(c); | ||
if (!visited[key]) { | ||
visited[key] = true; | ||
sorted.push(c); | ||
} | ||
} | ||
@@ -119,4 +121,3 @@ } | ||
for (var key in this._computed) { | ||
cycles = blankObject(); | ||
visit(key); | ||
visit(currentKey = key); | ||
} | ||
@@ -123,0 +124,0 @@ }, |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2550201
24051