Skip to content
This repository was archived by the owner on Jul 6, 2020. It is now read-only.

Commit 2e32dc8

Browse files
committed
Fixes Node.freeze.
When I added the style property to the node object, I forgot to update `Node.freeze` accordingly. This is a breaking change.
1 parent dfde2a9 commit 2e32dc8

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

dist/lmth.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function Node(name, id, class_, style, attributes, content, children) {
2828
this.style = style;
2929
this.attributes = attributes;
3030
this.content = content;
31-
this.children = children || [];
31+
this.children = children;
3232

3333
return this;
3434
}
@@ -184,7 +184,7 @@ Node.voidElements = [
184184

185185
/* Provides an immutable view of a node; removing its children. */
186186
Node.freeze = function freeze(node) {
187-
return Node.new(node.name, node.id, node.class, node.attributes, node.content);
187+
return Node.new(node.name, node.id, node.class, node.style, node.attributes, node.content, []);
188188
};
189189

190190
/* Transforms a node tree into a nested list by taking each node and applying

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lmth",
3-
"version": "1.0.0",
3+
"version": "2.0.0",
44
"description": "A \"type-safe\" HTML DSL for JavaScript environments.",
55
"main": "lib/index.js",
66
"scripts": {

0 commit comments

Comments
 (0)