Skip to content
This repository has been archived by the owner on Oct 19, 2021. It is now read-only.

Commit

Permalink
Prevent a weird bug where the initializer defined by mutant isn't found
Browse files Browse the repository at this point in the history
  • Loading branch information
plexus committed Mar 14, 2015
1 parent 8accefd commit f8972b9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
8 changes: 7 additions & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
### Development

[full diff](http://github.com/plexus/hexp/compare/v0.4.5...master)
[full diff](http://github.com/plexus/hexp/compare/v0.4.6...master)

### v0.4.6

* Bugfix: make sure the Node constructors correctly calls the
constructor defined by Concord. This bug was being triggered by
asset_packer. Not sure how or why, but this fixes it.

### v0.4.5

Expand Down
8 changes: 5 additions & 3 deletions lib/hexp/node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ def self.[](*args)
new(*args)
end

alias concord_init initialize

# Normalize the arguments
#
# @param args [Array] args a Hexp node components
Expand All @@ -130,11 +132,11 @@ def initialize(*args)
args[1].all? {|k,v| k.instance_of?(String) && v.instance_of?(String) }

if attrs_ok && args[2].instance_of?(List)
super(args[0], args[1], args[2])
concord_init(args[0], args[1], args[2])
elsif attrs_ok && args[2].instance_of?(Array)
super(args[0], args[1], List.new(args[2]))
concord_init(args[0], args[1], List.new(args[2]))
else
super(*Normalize.new(args).call)
concord_init(*Normalize.new(args).call)
end.freeze
end

Expand Down
2 changes: 1 addition & 1 deletion lib/hexp/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Hexp
VERSION = '0.4.5'
VERSION = '0.4.6'
end

0 comments on commit f8972b9

Please sign in to comment.