Skip to content

Commit ed8de89

Browse files
committed
- fix bug: '' treated as undefined and thus can't be mapped to a node, causing node not found issue.
- bump version
1 parent 87185f5 commit ed8de89

File tree

7 files changed

+14
-9
lines changed

7 files changed

+14
-9
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
- remove `setContext()` and `setCtx()`, in favor of `ctx()`.
88

99

10+
## v1.4.3
11+
12+
- fix bug: `''` treated as undefined and thus can't be mapped to a node, causing node not found issue.
13+
14+
1015
## v1.4.2
1116

1217
- fix bug: incorrect variable used in checking `consumed`.

dist/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@
266266
k = getkey(n._data);
267267
if ((typeof k !== 'object' && !usekey) || (typeof k === 'object' && !in$(n._data, list)) || (usekey && !keycount[k])) {
268268
data.container.removeChild(n);
269-
n._data = null;
269+
delete n._data;
270270
} else {
271271
items.push(k);
272272
if (usekey && keycount[k]) {
@@ -275,7 +275,7 @@
275275
}
276276
return n;
277277
}).filter(function(it){
278-
return it._data;
278+
return it._data != null;
279279
});
280280
proxyIndex = Array.from(data.container.childNodes).indexOf(data.proxy);
281281
if (proxyIndex < 0) {

dist/index.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"browser": "dist/index.min.js",
66
"main": "dist/index.min.js",
77
"description": "view template micro framework",
8-
"version": "1.4.2",
8+
"version": "1.4.3",
99
"files": [
1010
"dist/**/*"
1111
],

src/ldview.ls

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,14 +151,14 @@ ldview.prototype = Object.create(Object.prototype) <<< do
151151
or (typeof(k) == \object and !(n._data in list)) # obj: match obj directly
152152
or (usekey and !keycount[k]) => # has getkey with nonobj key, but not exists
153153
data.container.removeChild n
154-
n._data = null
154+
delete n._data
155155
else
156156
items.push k
157157
# has getkey with nonobj key, and exist.
158158
# reduce same key count to balance between data and node
159159
if usekey and keycount[k] => keycount[k]--
160160
n
161-
.filter (._data)
161+
.filter -> it._data?
162162
proxy-index = Array.from(data.container.childNodes).indexOf(data.proxy)
163163
if proxy-index < 0 => proxy-index = data.container.childNodes.length
164164
ns = []

web/static/assets/lib/ldview/dev/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@
266266
k = getkey(n._data);
267267
if ((typeof k !== 'object' && !usekey) || (typeof k === 'object' && !in$(n._data, list)) || (usekey && !keycount[k])) {
268268
data.container.removeChild(n);
269-
n._data = null;
269+
delete n._data;
270270
} else {
271271
items.push(k);
272272
if (usekey && keycount[k]) {
@@ -275,7 +275,7 @@
275275
}
276276
return n;
277277
}).filter(function(it){
278-
return it._data;
278+
return it._data != null;
279279
});
280280
proxyIndex = Array.from(data.container.childNodes).indexOf(data.proxy);
281281
if (proxyIndex < 0) {

web/static/assets/lib/ldview/dev/index.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)