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

Commit

Permalink
Fixes Node.freeze.
Browse files Browse the repository at this point in the history
When I added the style property to the node object, I forgot to update
`Node.freeze` accordingly.

This is a breaking change.
  • Loading branch information
chrisdotcode committed Mar 3, 2016
1 parent dfde2a9 commit 2e32dc8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions dist/lmth.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function Node(name, id, class_, style, attributes, content, children) {
this.style = style;
this.attributes = attributes;
this.content = content;
this.children = children || [];
this.children = children;

return this;
}
Expand Down Expand Up @@ -184,7 +184,7 @@ Node.voidElements = [

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

/* Transforms a node tree into a nested list by taking each node and applying
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lmth",
"version": "1.0.0",
"version": "2.0.0",
"description": "A \"type-safe\" HTML DSL for JavaScript environments.",
"main": "lib/index.js",
"scripts": {
Expand Down

0 comments on commit 2e32dc8

Please sign in to comment.