Repository: bem/bh (js)

Issue:
BH doesn't extend client 'js' param when it equal true
BEMJSON
```
bh.match('button', function(ctx) {
    ctx.js({ a: 1 });
});
bh.apply({ block: 'button', js: true });
```

Result should be equal `<div class="button i-bem" onclick='return {"button":{"a":1}}'></div>`

Pull request:
BH doesn't extend client 'js' param when it equal true
Close #162 

Patch:
diff --git a/lib/bh.js b/lib/bh.js
index 0fb968f..9532123 100644
--- a/lib/bh.js
+++ b/lib/bh.js
@@ -438,7 +438,7 @@ function BH() {
             var ctx = this.ctx;
             if (js === undefined) return ctx.js;
             if (force || ctx.js === undefined) ctx.js = js;
-            else if (ctx.js !== false) this.extend(ctx.js, js);
+            else if (ctx.js !== false) ctx.js = this.extend(ctx.js, js);
             return this;
         },
         /**


Test patch:
diff --git a/test/test.js.js b/test/test.js.js
index 422033a..4130e87 100644
--- a/test/test.js.js
+++ b/test/test.js.js
@@ -43,6 +43,13 @@ describe('ctx.js()', function() {
             .should.equal('<div class="button i-bem" onclick=\'return {"button":{"x":1,"a":2}}\'></div>');
     });
 
+    it('should extend user js, when it equal true', function() {
+        bh.match('button', function(ctx) {
+            ctx.js({ a: 1 });
+        });
+        bh.apply({ block: 'button', js: true }).should.equal('<div class="button i-bem" onclick=\'return {"button":{"a":1}}\'></div>');
+    });
+
     it('should not override later declarations #1', function() {
         bh.match('button', function(ctx) {
             ctx.js(false);