Commit ce9b80de authored by nanocryk's avatar nanocryk
Browse files

changed JsInteger to JsNumber (JsInteger is gone in neon 0.1.21)

parent f0546226
...@@ -3,8 +3,8 @@ name = "duniter-rs-wotb-js" ...@@ -3,8 +3,8 @@ name = "duniter-rs-wotb-js"
version = "0.0.0" version = "0.0.0"
dependencies = [ dependencies = [
"duniter-rs-wotb 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "duniter-rs-wotb 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"neon 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)", "neon 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
"neon-build 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)", "neon-build 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
...@@ -69,22 +69,23 @@ dependencies = [ ...@@ -69,22 +69,23 @@ dependencies = [
[[package]] [[package]]
name = "neon" name = "neon"
version = "0.1.20" version = "0.1.21"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"cslice 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "cslice 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"neon-build 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)", "neon-build 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
"neon-runtime 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)", "neon-runtime 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
"semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
name = "neon-build" name = "neon-build"
version = "0.1.20" version = "0.1.21"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
name = "neon-runtime" name = "neon-runtime"
version = "0.1.20" version = "0.1.21"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"cslice 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "cslice 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
...@@ -114,6 +115,19 @@ name = "regex-syntax" ...@@ -114,6 +115,19 @@ name = "regex-syntax"
version = "0.4.1" version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "semver"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "semver-parser"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
name = "serde" name = "serde"
version = "1.0.19" version = "1.0.19"
...@@ -198,12 +212,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" ...@@ -198,12 +212,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum lazy_static 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)" = "c9e5e58fa1a4c3b915a561a78a22ee0cac6ab97dca2504428bc1cb074375f8d5" "checksum lazy_static 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)" = "c9e5e58fa1a4c3b915a561a78a22ee0cac6ab97dca2504428bc1cb074375f8d5"
"checksum libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "5ba3df4dcb460b9dfbd070d41c94c19209620c191b0340b929ce748a2bcd42d2" "checksum libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "5ba3df4dcb460b9dfbd070d41c94c19209620c191b0340b929ce748a2bcd42d2"
"checksum memchr 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "148fab2e51b4f1cfc66da2a7c32981d1d3c083a803978268bb11fe4b86925e7a" "checksum memchr 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "148fab2e51b4f1cfc66da2a7c32981d1d3c083a803978268bb11fe4b86925e7a"
"checksum neon 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)" = "993372f453e05590ecf8ce5d63ec905836e8b8c4b504c56a55ea4b31ab8d198e" "checksum neon 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)" = "db10beb9c26bc6e505075387aaa7251d8d65076f06acfe85ef4df728ed5785b7"
"checksum neon-build 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)" = "d098a268ae7508a1196c87bf3cf0f5835247d4e1babc07ccf01b4535b74394cb" "checksum neon-build 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)" = "e137cafeb2297a81d4c3e41a7c703570459c49a7c0a1623a4925e2a9fdb3eeb9"
"checksum neon-runtime 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)" = "f85b6c58cdd80613db616fe7ca8318ca6414d4af1ad49d80481a525bc1c6d905" "checksum neon-runtime 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)" = "d8fa795c92c21498f215ee610671b2cc9260dbb5e02239e6b2d91f42d6d98014"
"checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a" "checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a"
"checksum regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1731164734096285ec2a5ec7fea5248ae2f5485b3feeb0115af4fda2183b2d1b" "checksum regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1731164734096285ec2a5ec7fea5248ae2f5485b3feeb0115af4fda2183b2d1b"
"checksum regex-syntax 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ad890a5eef7953f55427c50575c680c42841653abd2b028b68cd223d157f62db" "checksum regex-syntax 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ad890a5eef7953f55427c50575c680c42841653abd2b028b68cd223d157f62db"
"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
"checksum serde 1.0.19 (registry+https://github.com/rust-lang/crates.io-index)" = "0c9cab69e16835717c9b8bd13c29f92b6aa34fe32ce2866b1ab481cf2da8442a" "checksum serde 1.0.19 (registry+https://github.com/rust-lang/crates.io-index)" = "0c9cab69e16835717c9b8bd13c29f92b6aa34fe32ce2866b1ab481cf2da8442a"
"checksum serde_derive 1.0.19 (registry+https://github.com/rust-lang/crates.io-index)" = "3bdafe3e71710131a919735916caa5b18c2754ad0d33d8ae5d586ccc804a403e" "checksum serde_derive 1.0.19 (registry+https://github.com/rust-lang/crates.io-index)" = "3bdafe3e71710131a919735916caa5b18c2754ad0d33d8ae5d586ccc804a403e"
"checksum serde_derive_internals 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)" = "32f1926285523b2db55df263d2aa4eb69ddcfa7a7eade6430323637866b513ab" "checksum serde_derive_internals 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)" = "32f1926285523b2db55df263d2aa4eb69ddcfa7a7eade6430323637866b513ab"
......
...@@ -10,8 +10,8 @@ name = "duniter_rs_wotb_js" ...@@ -10,8 +10,8 @@ name = "duniter_rs_wotb_js"
crate-type = ["dylib"] crate-type = ["dylib"]
[build-dependencies] [build-dependencies]
neon-build = "0.1.20" neon-build = "0.1.21"
[dependencies] [dependencies]
neon = "0.1.20" neon = "0.1.21"
duniter-rs-wotb = "0.3.2" duniter-rs-wotb = "0.3.2"
...@@ -6,7 +6,7 @@ extern crate duniter_rs_wotb; ...@@ -6,7 +6,7 @@ extern crate duniter_rs_wotb;
use std::path::Path; use std::path::Path;
use neon::js::{Value, JsInteger, JsString, JsBoolean, JsFunction, JsArray, JsNumber, JsObject, use neon::js::{Value, JsString, JsBoolean, JsFunction, JsArray, JsNumber, JsObject,
Object}; Object};
use neon::js::class::{Class, JsClass}; use neon::js::class::{Class, JsClass};
use neon::mem::Handle; use neon::mem::Handle;
...@@ -22,10 +22,10 @@ declare_types! { ...@@ -22,10 +22,10 @@ declare_types! {
let scope = call.scope; let scope = call.scope;
let arg0 = try!(call.arguments.require(scope, 0)); let arg0 = try!(call.arguments.require(scope, 0));
if let Some(max_cert) = arg0.downcast::<JsInteger>() { if let Some(max_cert) = arg0.downcast::<JsNumber>() {
let max_cert = max_cert.value(); let max_cert = max_cert.value();
match max_cert > 0 { match max_cert > 0.0 {
true => Ok(WebOfTrust::new(max_cert as usize)), true => Ok(WebOfTrust::new(max_cert as usize)),
false => Err(Throw), false => Err(Throw),
} }
...@@ -65,7 +65,7 @@ declare_types! { ...@@ -65,7 +65,7 @@ declare_types! {
wot.add_node() wot.add_node()
}); });
Ok(JsInteger::new(scope, *id as i32).upcast()) Ok(JsNumber::new(scope, *id as f64).upcast())
} }
method removeNode(call) { method removeNode(call) {
...@@ -73,19 +73,19 @@ declare_types! { ...@@ -73,19 +73,19 @@ declare_types! {
let id = call.arguments.this(scope).grab(|wot| { let id = call.arguments.this(scope).grab(|wot| {
match wot.remove_node() { match wot.remove_node() {
Some(id) => *id as i32, Some(id) => *id as f64,
None => -1, None => -1f64,
} }
}); });
Ok(JsInteger::new(scope, id).upcast()) Ok(JsNumber::new(scope, id).upcast())
} }
method getSentries(call) { method getSentries(call) {
let scope = call.scope; let scope = call.scope;
let arg0 = try!(call.arguments.require(scope, 0)); let arg0 = try!(call.arguments.require(scope, 0));
let d_min = try!(arg0.check::<JsInteger>()).value() as usize; let d_min = try!(arg0.check::<JsNumber>()).value() as usize;
let array = call.arguments.this(scope).grab(|wot| { let array = call.arguments.this(scope).grab(|wot| {
wot.get_sentries(d_min) wot.get_sentries(d_min)
...@@ -94,7 +94,7 @@ declare_types! { ...@@ -94,7 +94,7 @@ declare_types! {
let jsarray: Handle<JsArray> = JsArray::new(scope, array.len() as u32); let jsarray: Handle<JsArray> = JsArray::new(scope, array.len() as u32);
for (index, &item) in array.iter().enumerate() { for (index, &item) in array.iter().enumerate() {
try!(jsarray.set(index as u32, JsInteger::new(scope, *item as i32))); try!(jsarray.set(index as u32, JsNumber::new(scope, *item as f64)));
} }
Ok(jsarray.upcast()) Ok(jsarray.upcast())
...@@ -104,7 +104,7 @@ declare_types! { ...@@ -104,7 +104,7 @@ declare_types! {
let scope = call.scope; let scope = call.scope;
let arg0 = try!(call.arguments.require(scope, 0)); let arg0 = try!(call.arguments.require(scope, 0));
let d_min = try!(arg0.check::<JsInteger>()).value() as usize; let d_min = try!(arg0.check::<JsNumber>()).value() as usize;
let array = call.arguments.this(scope).grab(|wot| { let array = call.arguments.this(scope).grab(|wot| {
wot.get_non_sentries(d_min) wot.get_non_sentries(d_min)
...@@ -113,7 +113,7 @@ declare_types! { ...@@ -113,7 +113,7 @@ declare_types! {
let jsarray: Handle<JsArray> = JsArray::new(scope, array.len() as u32); let jsarray: Handle<JsArray> = JsArray::new(scope, array.len() as u32);
for (index, &item) in array.iter().enumerate() { for (index, &item) in array.iter().enumerate() {
try!(jsarray.set(index as u32, JsInteger::new(scope, *item as i32))); try!(jsarray.set(index as u32, JsNumber::new(scope, *item as f64)));
} }
Ok(jsarray.upcast()) Ok(jsarray.upcast())
...@@ -129,7 +129,7 @@ declare_types! { ...@@ -129,7 +129,7 @@ declare_types! {
let jsarray: Handle<JsArray> = JsArray::new(scope, array.len() as u32); let jsarray: Handle<JsArray> = JsArray::new(scope, array.len() as u32);
for (index, &item) in array.iter().enumerate() { for (index, &item) in array.iter().enumerate() {
try!(jsarray.set(index as u32, JsInteger::new(scope, *item as i32))); try!(jsarray.set(index as u32, JsNumber::new(scope, *item as f64)));
} }
Ok(jsarray.upcast()) Ok(jsarray.upcast())
...@@ -138,9 +138,9 @@ declare_types! { ...@@ -138,9 +138,9 @@ declare_types! {
method getPaths(call) { method getPaths(call) {
let scope = call.scope; let scope = call.scope;
let from = try!(try!(call.arguments.require(scope, 0)).check::<JsInteger>()).value() as usize; let from = try!(try!(call.arguments.require(scope, 0)).check::<JsNumber>()).value() as usize;
let to = try!(try!(call.arguments.require(scope, 1)).check::<JsInteger>()).value() as usize; let to = try!(try!(call.arguments.require(scope, 1)).check::<JsNumber>()).value() as usize;
let k_max = try!(try!(call.arguments.require(scope, 2)).check::<JsInteger>()).value() as u32; let k_max = try!(try!(call.arguments.require(scope, 2)).check::<JsNumber>()).value() as u32;
let paths = call.arguments.this(scope).grab(|wot| { let paths = call.arguments.this(scope).grab(|wot| {
wot.get_paths(NodeId(from), NodeId(to), k_max) wot.get_paths(NodeId(from), NodeId(to), k_max)
...@@ -152,7 +152,7 @@ declare_types! { ...@@ -152,7 +152,7 @@ declare_types! {
let inner_jsarray: Handle<JsArray> = JsArray::new(scope, inner_array.len() as u32); let inner_jsarray: Handle<JsArray> = JsArray::new(scope, inner_array.len() as u32);
for(inner_index, &item) in inner_array.iter().enumerate() { for(inner_index, &item) in inner_array.iter().enumerate() {
try!(inner_jsarray.set(inner_index as u32, JsInteger::new(scope, *item as i32))); try!(inner_jsarray.set(inner_index as u32, JsNumber::new(scope, *item as f64)));
} }
try!(jsarray.set(index as u32, inner_jsarray)); try!(jsarray.set(index as u32, inner_jsarray));
...@@ -168,13 +168,13 @@ declare_types! { ...@@ -168,13 +168,13 @@ declare_types! {
wot.size() wot.size()
}); });
Ok(JsInteger::new(scope, size as i32).upcast()) Ok(JsNumber::new(scope, size as f64).upcast())
} }
method isEnabled(call) { method isEnabled(call) {
let scope = call.scope; let scope = call.scope;
let node = try!(try!(call.arguments.require(scope, 0)).check::<JsInteger>()).value() as usize; let node = try!(try!(call.arguments.require(scope, 0)).check::<JsNumber>()).value() as usize;
match call.arguments.this(scope).grab(|wot| { match call.arguments.this(scope).grab(|wot| {
wot.is_enabled(NodeId(node)) wot.is_enabled(NodeId(node))
...@@ -187,7 +187,7 @@ declare_types! { ...@@ -187,7 +187,7 @@ declare_types! {
method setEnabled(call) { method setEnabled(call) {
let scope = call.scope; let scope = call.scope;
let node = try!(try!(call.arguments.require(scope, 0)).check::<JsInteger>()).value() as usize; let node = try!(try!(call.arguments.require(scope, 0)).check::<JsNumber>()).value() as usize;
let state = try!(try!(call.arguments.require(scope, 1)).check::<JsBoolean>()).value(); let state = try!(try!(call.arguments.require(scope, 1)).check::<JsBoolean>()).value();
match call.arguments.this(scope).grab(|wot| { match call.arguments.this(scope).grab(|wot| {
...@@ -201,15 +201,15 @@ declare_types! { ...@@ -201,15 +201,15 @@ declare_types! {
method addLink(call) { method addLink(call) {
let scope = call.scope; let scope = call.scope;
let from = try!(try!(call.arguments.require(scope, 0)).check::<JsInteger>()).value() as usize; let from = try!(try!(call.arguments.require(scope, 0)).check::<JsNumber>()).value() as usize;
let to = try!(try!(call.arguments.require(scope, 1)).check::<JsInteger>()).value() as usize; let to = try!(try!(call.arguments.require(scope, 1)).check::<JsNumber>()).value() as usize;
match call.arguments.this(scope).grab(|wot| { match call.arguments.this(scope).grab(|wot| {
wot.add_link(NodeId(from), NodeId(to)) wot.add_link(NodeId(from), NodeId(to))
}) { }) {
NewLinkResult::Ok(count) | NewLinkResult::Ok(count) |
NewLinkResult::AlreadyCertified(count) | NewLinkResult::AlreadyCertified(count) |
NewLinkResult::AllCertificationsUsed(count) => Ok(JsInteger::new(scope, count as i32).upcast()), NewLinkResult::AllCertificationsUsed(count) => Ok(JsNumber::new(scope, count as f64).upcast()),
_ => Err(Throw), _ => Err(Throw),
} }
} }
...@@ -217,13 +217,13 @@ declare_types! { ...@@ -217,13 +217,13 @@ declare_types! {
method removeLink(call) { method removeLink(call) {
let scope = call.scope; let scope = call.scope;
let from = try!(try!(call.arguments.require(scope, 0)).check::<JsInteger>()).value() as usize; let from = try!(try!(call.arguments.require(scope, 0)).check::<JsNumber>()).value() as usize;
let to = try!(try!(call.arguments.require(scope, 1)).check::<JsInteger>()).value() as usize; let to = try!(try!(call.arguments.require(scope, 1)).check::<JsNumber>()).value() as usize;
match call.arguments.this(scope).grab(|wot| { match call.arguments.this(scope).grab(|wot| {
wot.remove_link(NodeId(from), NodeId(to)) wot.remove_link(NodeId(from), NodeId(to))
}) { }) {
RemovedLinkResult::Removed(count) => Ok(JsInteger::new(scope, count as i32).upcast()), RemovedLinkResult::Removed(count) => Ok(JsNumber::new(scope, count as f64).upcast()),
_ => Err(Throw), _ => Err(Throw),
} }
} }
...@@ -231,8 +231,8 @@ declare_types! { ...@@ -231,8 +231,8 @@ declare_types! {
method existsLink(call) { method existsLink(call) {
let scope = call.scope; let scope = call.scope;
let from = try!(try!(call.arguments.require(scope, 0)).check::<JsInteger>()).value() as usize; let from = try!(try!(call.arguments.require(scope, 0)).check::<JsNumber>()).value() as usize;
let to = try!(try!(call.arguments.require(scope, 1)).check::<JsInteger>()).value() as usize; let to = try!(try!(call.arguments.require(scope, 1)).check::<JsNumber>()).value() as usize;
let result = call.arguments.this(scope).grab(|wot| { let result = call.arguments.this(scope).grab(|wot| {
wot.exists_link(NodeId(from), NodeId(to)) wot.exists_link(NodeId(from), NodeId(to))
...@@ -244,9 +244,9 @@ declare_types! { ...@@ -244,9 +244,9 @@ declare_types! {
method isOutdistanced(call) { method isOutdistanced(call) {
let scope = call.scope; let scope = call.scope;
let node = try!(try!(call.arguments.require(scope, 0)).check::<JsInteger>()).value() as usize; let node = try!(try!(call.arguments.require(scope, 0)).check::<JsNumber>()).value() as usize;
let d_min = try!(try!(call.arguments.require(scope, 1)).check::<JsInteger>()).value() as u32; let d_min = try!(try!(call.arguments.require(scope, 1)).check::<JsNumber>()).value() as u32;
let d_max = try!(try!(call.arguments.require(scope, 2)).check::<JsInteger>()).value() as u32; let d_max = try!(try!(call.arguments.require(scope, 2)).check::<JsNumber>()).value() as u32;
let x_percent = try!(try!(call.arguments.require(scope, 3)).check::<JsNumber>()).value() as f64; let x_percent = try!(try!(call.arguments.require(scope, 3)).check::<JsNumber>()).value() as f64;
match call.arguments.this(scope).grab(|wot| { match call.arguments.this(scope).grab(|wot| {
...@@ -260,7 +260,7 @@ declare_types! { ...@@ -260,7 +260,7 @@ declare_types! {
method setMaxCert(call) { method setMaxCert(call) {
let scope = call.scope; let scope = call.scope;
let max_cert = try!(try!(call.arguments.require(scope, 0)).check::<JsInteger>()).value() as usize; let max_cert = try!(try!(call.arguments.require(scope, 0)).check::<JsNumber>()).value() as usize;
call.arguments.this(scope).grab(|wot| { call.arguments.this(scope).grab(|wot| {
wot.max_cert = max_cert; wot.max_cert = max_cert;
...@@ -276,15 +276,15 @@ declare_types! { ...@@ -276,15 +276,15 @@ declare_types! {
wot.max_cert wot.max_cert
}); });
Ok(JsInteger::new(scope, max_cert as i32).upcast()) Ok(JsNumber::new(scope, max_cert as f64).upcast())
} }
method detailedDistance(call) { method detailedDistance(call) {
let scope = call.scope; let scope = call.scope;
let node = try!(try!(call.arguments.require(scope, 0)).check::<JsInteger>()).value() as usize; let node = try!(try!(call.arguments.require(scope, 0)).check::<JsNumber>()).value() as usize;
let d_min = try!(try!(call.arguments.require(scope, 1)).check::<JsInteger>()).value() as u32; let d_min = try!(try!(call.arguments.require(scope, 1)).check::<JsNumber>()).value() as u32;
let d_max = try!(try!(call.arguments.require(scope, 2)).check::<JsInteger>()).value() as u32; let d_max = try!(try!(call.arguments.require(scope, 2)).check::<JsNumber>()).value() as u32;
let x_percent = try!(try!(call.arguments.require(scope, 3)).check::<JsNumber>()).value() as f64; let x_percent = try!(try!(call.arguments.require(scope, 3)).check::<JsNumber>()).value() as f64;
let wot_distance = call.arguments.this(scope).grab(|wot| { let wot_distance = call.arguments.this(scope).grab(|wot| {
...@@ -292,9 +292,9 @@ declare_types! { ...@@ -292,9 +292,9 @@ declare_types! {
}); });
let jsobject = JsObject::new(scope); let jsobject = JsObject::new(scope);
try!(jsobject.set("nbReached", JsInteger::new(scope, wot_distance.reached as i32))); try!(jsobject.set("nbReached", JsNumber::new(scope, wot_distance.reached as f64)));
try!(jsobject.set("nbSuccess", JsInteger::new(scope, wot_distance.success as i32))); try!(jsobject.set("nbSuccess", JsNumber::new(scope, wot_distance.success as f64)));
try!(jsobject.set("nbSentries", JsInteger::new(scope, wot_distance.sentries as i32))); try!(jsobject.set("nbSentries", JsNumber::new(scope, wot_distance.sentries as f64)));
try!(jsobject.set("isOutdistanced", JsBoolean::new(scope, wot_distance.outdistanced))); try!(jsobject.set("isOutdistanced", JsBoolean::new(scope, wot_distance.outdistanced)));
Ok(jsobject.upcast()) Ok(jsobject.upcast())
...@@ -306,7 +306,7 @@ declare_types! { ...@@ -306,7 +306,7 @@ declare_types! {
let class: Handle<JsClass<JsWebOfTrust>> = try!(JsWebOfTrust::class(scope)); let class: Handle<JsClass<JsWebOfTrust>> = try!(JsWebOfTrust::class(scope));
let constructor: Handle<JsFunction<JsWebOfTrust>> = try!(class.constructor(scope)); let constructor: Handle<JsFunction<JsWebOfTrust>> = try!(class.constructor(scope));
let ctor_args = vec![JsInteger::new(scope, 1)]; let ctor_args = vec![JsNumber::new(scope, 1f64)];
let mut new_jswot: Handle<JsWebOfTrust> = try!(constructor.construct(scope, ctor_args)); let mut new_jswot: Handle<JsWebOfTrust> = try!(constructor.construct(scope, ctor_args));
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
"author": "nanocryk <nanocryk@gmail.com>", "author": "nanocryk <nanocryk@gmail.com>",
"license": "GPL-3.0", "license": "GPL-3.0",
"dependencies": { "dependencies": {
"neon-cli": "^0.1.20", "neon-cli": "^0.1.21",
"aws-sdk": "2.2.43", "aws-sdk": "2.2.43",
"mocha": "2.2.5", "mocha": "2.2.5",
"should": "8.1.1" "should": "8.1.1"
......
...@@ -28,18 +28,10 @@ ansi-escapes@^3.0.0: ...@@ -28,18 +28,10 @@ ansi-escapes@^3.0.0:
version "3.0.0" version "3.0.0"
resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.0.0.tgz#ec3e8b4e9f8064fc02c3ac9b65f1c275bda8ef92" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.0.0.tgz#ec3e8b4e9f8064fc02c3ac9b65f1c275bda8ef92"
ansi-regex@^2.0.0:
version "2.1.1"
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df"
ansi-regex@^3.0.0: ansi-regex@^3.0.0:
version "3.0.0" version "3.0.0"
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998"
ansi-styles@^2.2.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe"
ansi-styles@^3.1.0: ansi-styles@^3.1.0:
version "3.2.0" version "3.2.0"
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.0.tgz#c159b8d5be0f9e5a6f346dab94f16ce022161b88" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.0.tgz#c159b8d5be0f9e5a6f346dab94f16ce022161b88"
...@@ -81,9 +73,9 @@ brace-expansion@^1.1.7: ...@@ -81,9 +73,9 @@ brace-expansion@^1.1.7:
balanced-match "^1.0.0" balanced-match "^1.0.0"
concat-map "0.0.1" concat-map "0.0.1"
builtins@0.0.7: builtins@^1.0.3:
version "0.0.7" version "1.0.3"
resolved "https://registry.yarnpkg.com/builtins/-/builtins-0.0.7.tgz#355219cd6cf18dbe7c01cc7fd2dce765cfdc549a" resolved "https://registry.yarnpkg.com/builtins/-/builtins-1.0.3.tgz#cb94faeb61c8696451db36534e1422f94f0aee88"
camelcase@^1.0.2: camelcase@^1.0.2:
version "1.2.1" version "1.2.1"
...@@ -96,16 +88,6 @@ center-align@^0.1.1: ...@@ -96,16 +88,6 @@ center-align@^0.1.1:
align-text "^0.1.3" align-text "^0.1.3"
lazy-cache "^1.0.3" lazy-cache "^1.0.3"
chalk@^1.1.1:
version "1.1.3"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98"
dependencies:
ansi-styles "^2.2.1"
escape-string-regexp "^1.0.2"
has-ansi "^2.0.0"
strip-ansi "^3.0.0"
supports-color "^2.0.0"
chalk@^2.0.0: chalk@^2.0.0:
version "2.3.0" version "2.3.0"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.3.0.tgz#b5ea48efc9c1793dccc9b4767c93914d3f2d52ba" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.3.0.tgz#b5ea48efc9c1793dccc9b4767c93914d3f2d52ba"
...@@ -114,6 +96,14 @@ chalk@^2.0.0: ...@@ -114,6 +96,14 @@ chalk@^2.0.0:
escape-string-regexp "^1.0.5" escape-string-regexp "^1.0.5"
supports-color "^4.0.0" supports-color "^4.0.0"
chalk@~2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.1.0.tgz#ac5becf14fa21b99c6c92ca7a7d7cfd5b17e743e"
dependencies:
ansi-styles "^3.1.0"
escape-string-regexp "^1.0.5"
supports-color "^4.0.0"
cli-cursor@^2.1.0: cli-cursor@^2.1.0:
version "2.1.0" version "2.1.0"
resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5"
...@@ -199,7 +189,7 @@ escape-string-regexp@1.0.2: ...@@ -199,7 +189,7 @@ escape-string-regexp@1.0.2:
version "1.0.2" version "1.0.2"
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.2.tgz#4dbc2fe674e71949caf3fb2695ce7f2dc1d9a8d1" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.2.tgz#4dbc2fe674e71949caf3fb2695ce7f2dc1d9a8d1"
escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: escape-string-regexp@^1.0.5:
version "1.0.5" version "1.0.5"
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
...@@ -271,12 +261,6 @@ handlebars@^4.0.3: ...@@ -271,12 +261,6 @@ handlebars@^4.0.3:
optionalDependencies: optionalDependencies:
uglify-js "^2.6" uglify-js "^2.6"
has-ansi@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91"
dependencies:
ansi-regex "^2.0.0"
has-flag@^2.0.0: has-flag@^2.0.0:
version "2.0.0" version "2.0.0"
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51"
...@@ -285,10 +269,6 @@ iconv-lite@^0.4.17: ...@@ -285,10 +269,6 @@ iconv-lite@^0.4.17:
version "0.4.19" version "0.4.19"
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b"