Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug with ctx.js() #160

Closed
arikon opened this issue Aug 13, 2015 · 6 comments · Fixed by #161
Closed

Bug with ctx.js() #160

arikon opened this issue Aug 13, 2015 · 6 comments · Fixed by #161
Labels

Comments

@arikon
Copy link
Member

arikon commented Aug 13, 2015

// ({block: 'block'})

bh.match('block', function(ctx) {
    ctx.js(false);
    ctx.js(true);
});

// <div class="block i-bem" data-bem='{"block":{}}'></div>

After the second call to ctx.js(true) the value of js is true. Should be false.

js() implementation in BH: https://github.com/bem/bh/blob/master/lib/bh.js#L437-L445
It seems that after the first call json.js stays undefined.
On the second call this happens: this.extend(undefined, true)
And then returns this: https://github.com/bem/bh/blob/master/lib/bh.js#L92

@arikon arikon added the bug label Aug 13, 2015
@qfox
Copy link
Member

qfox commented Aug 13, 2015

this.ctx.js = force ?this.ctx.js = force || this.ctx.js === undefined ?
plus specs?

mishanga added a commit that referenced this issue Aug 21, 2015
mishanga added a commit that referenced this issue Aug 21, 2015
mishanga added a commit that referenced this issue Aug 21, 2015
@arikon
Copy link
Member Author

arikon commented Aug 21, 2015

@mishanga Thanks!

@arikon
Copy link
Member Author

arikon commented Aug 21, 2015

@mishanga А в bh 3.x есть такая ошибка? Если да, то мы не сможем из islands оторвать костылик про это.

mishanga added a commit that referenced this issue Aug 24, 2015
Conflicts:
	lib/bh.js
@mishanga
Copy link
Member

@arikon да, выпустил 3.3.1

@arikon
Copy link
Member Author

arikon commented Aug 24, 2015

@mishanga Спасибо!

@mishanga
Copy link
Member

@arikon блин, не так сделал. Выпущу пакет bh-3x с этим фиксом.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants