Skip to content

Commit

Permalink
all tests working in browser :D
Browse files Browse the repository at this point in the history
  • Loading branch information
maraoz committed Feb 24, 2014
1 parent 3e5e005 commit b4642e8
Show file tree
Hide file tree
Showing 13 changed files with 681 additions and 735 deletions.
16 changes: 11 additions & 5 deletions Script.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,11 @@ function spec(b) {
var chunks = [];
for (var i in this.chunks)
{
var chunk = this.chunks[i];
if (chunk != 0)
chunks.push(chunk);
if (this.chunks.hasOwnProperty(i)) {
var chunk = this.chunks[i];
if (chunk != 0)
chunks.push(chunk);
}
}
this.chunks = chunks;
this.updateBuffer();
Expand All @@ -157,8 +159,11 @@ function spec(b) {
Script.prototype.prependOp0 = function()
{
var chunks = [0];
for (i in this.chunks)
chunks.push(this.chunks[i]);
for (i in this.chunks) {
if (this.chunks.hasOwnProperty(i)) {
chunks.push(this.chunks[i]);
}
}
this.chunks = chunks;
this.updateBuffer();
return this;
Expand Down Expand Up @@ -486,6 +491,7 @@ function spec(b) {

Script.chunksToBuffer = function (chunks) {
var buf = new Put();

for (var i = 0, l = chunks.length; i < l; i++) {
var data = chunks[i];
if (Buffer.isBuffer(data)) {
Expand Down
3 changes: 3 additions & 0 deletions browser/concat.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#! /bin/bash

cat browser.js crypto.js bitcoin.js navigator-adapter.js jsbn.js jsbn2.js prng4.js util.js rng.js ec.js sec.js ecdsa.js eckey.js > bitcoinjs-lib.js
55 changes: 0 additions & 55 deletions test/Script.js

This file was deleted.

8 changes: 3 additions & 5 deletions test/adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,11 @@ if (typeof require === 'undefined') {
var module = that[name];
if (!module) {
if (!bitcore[name])
throw new Error('Cannot find module "'+name+'"');
throw new Error('Cannot find module "' + name + '"');
return bitcore[name];
}
return module;
};

}

this.Buffer = require('Buffer');
this.Buffer = require('Buffer');

}
152 changes: 0 additions & 152 deletions test/base58_keys_invalid.json

This file was deleted.

0 comments on commit b4642e8

Please sign in to comment.