Skip to content

Conversation

@sreevisakh
Copy link

It was not reading options provided in the script tag. because default value was overriding. in line 86

It was not reading options provided in the script tag. because default value was overriding. in line 86
tagOptions[key] = null

options = extend {}, defaults, tagOptions
options = extend {}, tagOptions, defaults
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either I'm crazy or extend is incorrectly implemented, b/c the original implementation absolutely should result in tagOptions overriding defaults.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed with @zackbloom:

# Extend impl copied straight from Bucky (https://github.com/HubSpot/BuckyClient/blob/646ab9ebcbcaaab4e68c7fcbf66e109dd418b3b3/bucky.coffee#L18-L22https://github.com/HubSpot/BuckyClient/blob/646ab9ebcbcaaab4e68c7fcbf66e109dd418b3b3/bucky.coffee#L18-L22https://github.com/HubSpot/BuckyClient/blob/646ab9ebcbcaaab4e68c7fcbf66e109dd418b3b3/bucky.coffee#L18-L22)https://github.com/HubSpot/BuckyClient/blob/646ab9ebcbcaaab4e68c7fcbf66e109dd418b3b3/bucky.coffee#L18-L22)
extend = (a, objs...) ->
  for obj in objs
    for key, val of obj
      a[key] = val
  a

 console.log extend {}, { a: 1 }, { a: 2, b: 'other' }
 # => {a: 2, b: "other"}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants