jorgebucaran / superfine

Absolutely minimal view layer for building web interfaces
https://git.io/super
MIT License
1.57k stars 78 forks source link

Handle falsy attribute values correctly #50

Closed maxholman closed 6 years ago

maxholman commented 6 years ago

Closes #49

Logic is identical to that of hyperapp at time of writing

codecov-io commented 6 years ago

Codecov Report

Merging #50 into master will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #50   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           2      2           
  Lines         115    115           
  Branches       32     34    +2     
=====================================
  Hits          115    115
Impacted Files Coverage Δ
src/patch.js 100% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update ef045b0...b6984e5. Read the comment docs.

mindplay-dk commented 6 years ago

Should this also handle true?

I think all browsers will accept setAttribute(name, true), but technically it's wrong - the type of the second argument is string, and according to the specs, the correct way to set a value-less attribute is with the empty string "".

jorgebucaran commented 6 years ago

@mindplay-dk To what line would you be referring to?

jorgebucaran commented 6 years ago

Merged! 🎉