I don't know why, but classtool is adding the defineClass method to all js
objects in the browser. This if prevents the code from failing in the
browser due to this (k equals the defineClass function in one iteration).

I forked classtool and will see if I can fix that problem



On Wed, Feb 19, 2014 at 4:44 PM, Ryan X. Charles
<notifications@github.com>wrote:

> In RpcClient.js:
>
> > @@ -123,17 +123,19 @@ function ClassSpec(b) {
> >      };
> >
> >      for(var k in apiCalls) {
> > -      var spec = apiCalls[k].split(' ');
> > -      for (var i = 0; i < spec.length; i++) {
> > -        if(types[spec[i]]) {
> > -          spec[i] = types[spec[i]];
> > -        } else {
> > -          spec[i] = types.string;
> > +      if (apiCalls.hasOwnProperty(k)) {
>
> why is this new "if" necessary?
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/bitpay/bitcore/pull/82/files#r9879857>
> .
>