From efc381da216ad1ec12cd9ec36248c26cd3e6f883 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Flemstr=C3=B6m?= Date: Tue, 22 Nov 2016 23:00:16 +0100 Subject: [PATCH] Upgrade to latest v8 --- Cargo.lock | 123 ++++++++++++++++++++----------------------- src/query/context.rs | 34 ++++++++---- src/query/mod.rs | 3 +- src/value/toml.rs | 10 ++-- 4 files changed, 88 insertions(+), 82 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e3f114d6..3f3ea1fc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,7 +17,7 @@ dependencies = [ "regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)", "rmp 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.21 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)", "serde-avro 0.3.0", "serde-hjson 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde-protobuf 0.3.0", @@ -25,7 +25,7 @@ dependencies = [ "serde_json 0.8.1 (git+https://github.com/serde-rs/json.git?branch=v0.9.0)", "serde_yaml 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "v8 0.7.0 (git+https://github.com/dflemstr/v8-rs.git)", + "v8 0.8.0 (git+https://github.com/dflemstr/v8-rs.git)", "xdg-basedir 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "yaml-rust 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -164,7 +164,7 @@ dependencies = [ "lazy_static 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.21 (registry+https://github.com/rust-lang/crates.io-index)", - "strsim 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "strsim 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -237,8 +237,8 @@ name = "linked-hash-map" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_test 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_test 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -313,15 +313,6 @@ name = "pkg-config" version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "post-expansion" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "quote 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "protobuf" version = "1.0.24" @@ -382,7 +373,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "serde" -version = "0.8.17" +version = "0.8.18" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -396,8 +387,8 @@ dependencies = [ "lazy_static 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "linked-hash-map 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_codegen 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_codegen 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 0.8.3 (registry+https://github.com/rust-lang/crates.io-index)", "snap 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -411,7 +402,7 @@ dependencies = [ "linked-hash-map 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)", "regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -421,7 +412,7 @@ dependencies = [ "linked-hash-map 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "protobuf 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -430,28 +421,27 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "serde_codegen" -version = "0.8.17" +version = "0.8.18" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "post-expansion 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_codegen_internals 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syntex 0.48.0 (registry+https://github.com/rust-lang/crates.io-index)", - "syntex_syntax 0.48.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_codegen_internals 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)", + "syntex 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)", + "syntex_syntax 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "serde_codegen_internals" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "syn 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -462,7 +452,7 @@ dependencies = [ "dtoa 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "itoa 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -473,15 +463,15 @@ dependencies = [ "dtoa 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "itoa 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "serde_test" -version = "0.8.17" +version = "0.8.18" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -491,7 +481,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "dtoa 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "linked-hash-map 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)", "yaml-rust 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -506,12 +496,12 @@ dependencies = [ [[package]] name = "strsim" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "syn" -version = "0.9.2" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "quote 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -520,11 +510,11 @@ dependencies = [ [[package]] name = "syntex" -version = "0.48.0" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "syntex_errors 0.48.0 (registry+https://github.com/rust-lang/crates.io-index)", - "syntex_syntax 0.48.0 (registry+https://github.com/rust-lang/crates.io-index)", + "syntex_errors 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)", + "syntex_syntax 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -542,13 +532,13 @@ dependencies = [ [[package]] name = "syntex_errors" -version = "0.48.0" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.21 (registry+https://github.com/rust-lang/crates.io-index)", - "syntex_pos 0.48.0 (registry+https://github.com/rust-lang/crates.io-index)", + "syntex_pos 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)", "term 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -563,7 +553,7 @@ dependencies = [ [[package]] name = "syntex_pos" -version = "0.48.0" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "rustc-serialize 0.3.21 (registry+https://github.com/rust-lang/crates.io-index)", @@ -586,15 +576,15 @@ dependencies = [ [[package]] name = "syntex_syntax" -version = "0.48.0" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.21 (registry+https://github.com/rust-lang/crates.io-index)", - "syntex_errors 0.48.0 (registry+https://github.com/rust-lang/crates.io-index)", - "syntex_pos 0.48.0 (registry+https://github.com/rust-lang/crates.io-index)", + "syntex_errors 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)", + "syntex_pos 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)", "term 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -631,7 +621,7 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "rustc-serialize 0.3.21 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -654,19 +644,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "v8" -version = "0.7.0" -source = "git+https://github.com/dflemstr/v8-rs.git#a2e1b8907ac3dd17101f1e0f0e1ec16ee0e4e412" +version = "0.8.0" +source = "git+https://github.com/dflemstr/v8-rs.git#4ec734561b09caf9ed3c074d51af637d08a53888" dependencies = [ "error-chain 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "v8-sys 0.13.0 (git+https://github.com/dflemstr/v8-rs.git)", + "v8-sys 0.14.0 (git+https://github.com/dflemstr/v8-rs.git)", ] [[package]] name = "v8-api" -version = "0.6.0" -source = "git+https://github.com/dflemstr/v8-rs.git#a2e1b8907ac3dd17101f1e0f0e1ec16ee0e4e412" +version = "0.7.0" +source = "git+https://github.com/dflemstr/v8-rs.git#4ec734561b09caf9ed3c074d51af637d08a53888" dependencies = [ "clang 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -675,14 +665,14 @@ dependencies = [ [[package]] name = "v8-sys" -version = "0.13.0" -source = "git+https://github.com/dflemstr/v8-rs.git#a2e1b8907ac3dd17101f1e0f0e1ec16ee0e4e412" +version = "0.14.0" +source = "git+https://github.com/dflemstr/v8-rs.git#4ec734561b09caf9ed3c074d51af637d08a53888" dependencies = [ "bindgen 0.19.1 (registry+https://github.com/rust-lang/crates.io-index)", "clang 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", "gcc 0.3.38 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "v8-api 0.6.0 (git+https://github.com/dflemstr/v8-rs.git)", + "v8-api 0.7.0 (git+https://github.com/dflemstr/v8-rs.git)", ] [[package]] @@ -752,7 +742,6 @@ dependencies = [ "checksum ordered-float 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "37b8eade67f6fdf7e4049744d5439cfbfd33b684ef8991da4265eb5d5c9fb550" "checksum pest 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2f6666c81a6359af7a9dbc48f596d6f318a9dbaefdec248581ab836dc0c1f082" "checksum pkg-config 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8cee804ecc7eaf201a4a207241472cc870e825206f6c031e3ee2a72fa425f2fa" -"checksum post-expansion 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "31a834a6060acaef74a8d878f6ca37a2b86fefe042bbfe70689ba587e42526f9" "checksum protobuf 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)" = "6ec4c2fe04370298218a09ab53a534febf54c160c5554e4de987b6d73c916d5d" "checksum quote 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "ea1e0c9bc6bfb0a60d539aab6e338207c1a5456e62f5bd5375132cee119aa4b3" "checksum regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)" = "4fd4ace6a8cf7860714a2c2280d6c1f7e6a413486c13298bbc86fd3da019402f" @@ -762,25 +751,25 @@ dependencies = [ "checksum rustc-serialize 0.3.21 (registry+https://github.com/rust-lang/crates.io-index)" = "bff9fc1c79f2dec76b253273d07682e94a978bd8f132ded071188122b2af9818" "checksum rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "c5f5376ea5e30ce23c03eb77cbe4962b988deead10910c372b226388b594c084" "checksum semver 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)" = "d4f410fedcf71af0345d7607d246e7ad15faaadd49d240ee3b24e5dc21a820ac" -"checksum serde 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)" = "784e249221c84265caeb1e2fe48aeada86f67f5acb151bd3903c4585969e43f6" +"checksum serde 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)" = "d9b524a2fac246f45c36a7f3a5742c19dcb0b2d1252d1ad5458ca07f26e04a57" "checksum serde-hjson 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a2376ebb8976138927f48b49588ef73cde2f6591b8b3df22f4063e0f27b9bec" "checksum serde_cbor 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "30e4297414ba8969de8dac9061edfd720dafd8e5f2e5236d55fba55ddec2623d" -"checksum serde_codegen 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)" = "c3b932a3bb4d729e39aa04cc5e2f2ac70ba239a5a151d2dc9a1956fd6a2f7c15" -"checksum serde_codegen_internals 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "318f7e77aa5187391d74aaf4553d2189f56b0ce25e963414c951b97877ffdcec" +"checksum serde_codegen 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)" = "d658b798b60791e72c4d518bed618b12318527c7a5adae41c23da61fa3656bd6" +"checksum serde_codegen_internals 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)" = "59933a62554548c690d2673c5164f0c4a46be7c5731edfd94b0ecb1048940732" "checksum serde_json 0.8.1 (git+https://github.com/serde-rs/json.git?branch=v0.9.0)" = "" "checksum serde_json 0.8.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1cb6b19e74d9f65b9d03343730b643d729a446b29376785cd65efdff4675e2fc" -"checksum serde_test 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)" = "351d2dcfa73c874a8e8e1d8546f87017d051ef5570877928c889b923b7c30c2d" +"checksum serde_test 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)" = "6c2122529606178685adf8f0f59d5975fafbad3cc3a5d92f8cd42ac9d02dda7c" "checksum serde_yaml 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "545e06a77016c26c2014f08d485d8845f63b6c4158acc5a6a9fff505bba30bf6" "checksum snap 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "37877bedec5e9d6b3324b4f99886f118844903a4e7532e5e59c7afd264da7b4f" -"checksum strsim 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "50c069df92e4b01425a8bf3576d5d417943a6a7272fbabaf5bd80b1aaa76442e" -"checksum syn 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)" = "76c2db66dc579998854d84ff0ff4a81cb73e69596764d144ce7cece4d04ce6b5" -"checksum syntex 0.48.0 (registry+https://github.com/rust-lang/crates.io-index)" = "17e2e2ad78f4942d011750c304e9a9874717b6986c8fa2f6072f58fbd0835dcb" +"checksum strsim 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "67f84c44fbb2f91db7fef94554e6b2ac05909c9c0b0bc23bb98d3a1aebfe7f7c" +"checksum syn 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)" = "94e7d81ecd16d39f16193af05b8d5a0111b9d8d2f3f78f31760f327a247da777" +"checksum syntex 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3bd253b0d7d787723a33384d426f0ebec7f8edccfaeb2022d0177162bb134da0" "checksum syntex_errors 0.38.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8e3c2258334fabaf5f1ab617120873b0e98c000b44922dddd87114d9624ae72e" -"checksum syntex_errors 0.48.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0b2784ff2ca385a451f1f835dcb3926e5c61461c6468aac1e35edcbc4cd33808" +"checksum syntex_errors 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)" = "84822a1178204a191239ad844599f8c85c128cf9f4173397def4eb46b55b0aa1" "checksum syntex_pos 0.38.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2c9e05ba6a576789f42abe0b7cf31ec7a287842f2ad108e8bc75c33ccee05841" -"checksum syntex_pos 0.48.0 (registry+https://github.com/rust-lang/crates.io-index)" = "25fadff25e4db9336cd715dea4bc7d4bf51d08cc39a1463b689661f1dea6893c" +"checksum syntex_pos 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a43abded5057c75bac8555e46ec913ce502efb418267b1ab8e9783897470c7db" "checksum syntex_syntax 0.38.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e97cfcd911a5113fd13e6b47d8dc391923752acc53c675a504f0bcbc2b8d7a42" -"checksum syntex_syntax 0.48.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0c3c7d1082d30f7042d1e7b00bd2ab0466daa84529fa13891e9312d8a32fd97e" +"checksum syntex_syntax 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6ef781e4b60f03431f1b5b59843546ce60ae029a787770cf8e0969ac1fd063a5" "checksum term 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3deff8a2b3b6607d6d7cc32ac25c0b33709453ca9cceac006caac51e963cf94a" "checksum thread-id 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a9539db560102d1cef46b8b78ce737ff0bb64e7e18d35b2a5688f7d097d0ff03" "checksum thread_local 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "8576dbbfcaef9641452d5cf0df9b0e7eeab7694956dd33bb61515fb8f18cfdd5" @@ -788,9 +777,9 @@ dependencies = [ "checksum unicode-xid 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "36dff09cafb4ec7c8cf0023eb0b686cb6ce65499116a12201c9e11840ca01beb" "checksum unreachable 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1f2ae5ddb18e1c92664717616dd9549dde73f539f01bd7b77c2edb2446bdff91" "checksum utf8-ranges 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a1ca13c08c41c9c3e04224ed9ff80461d97e121589ff27c753a16cb10830ae0f" -"checksum v8 0.7.0 (git+https://github.com/dflemstr/v8-rs.git)" = "" -"checksum v8-api 0.6.0 (git+https://github.com/dflemstr/v8-rs.git)" = "" -"checksum v8-sys 0.13.0 (git+https://github.com/dflemstr/v8-rs.git)" = "" +"checksum v8 0.8.0 (git+https://github.com/dflemstr/v8-rs.git)" = "" +"checksum v8-api 0.7.0 (git+https://github.com/dflemstr/v8-rs.git)" = "" +"checksum v8-sys 0.14.0 (git+https://github.com/dflemstr/v8-rs.git)" = "" "checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" "checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" "checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" diff --git a/src/query/context.rs b/src/query/context.rs index 47587dfb..85496cfe 100644 --- a/src/query/context.rs +++ b/src/query/context.rs @@ -12,8 +12,8 @@ use value; const API_JS: &'static str = include_str!("../api.js"); const PRELUDE_JS: &'static str = include_str!("../prelude.js"); -const MODULES: &'static [(&'static str, &'static str)] = - &[("lodash", include_str!("../js/lodash.js"))]; +const MODULES: &'static [(&'static str, &'static str)] = &[("lodash", + include_str!("../js/lodash.js"))]; #[derive(Debug)] pub struct Context { @@ -243,7 +243,10 @@ fn build_log_fun(isolate: &v8::Isolate, outer_context: &v8::Context) -> v8::valu Box::new(move |mut info| { let isolate = info.isolate; if info.args.len() < 2 { - v8::value::undefined(&isolate).into() + let message = v8::value::String::from_str(&isolate, + "log() called with too few arguments, \ + requires at least two"); + Err(v8::value::Exception::error(&isolate, &message).into()) } else if let (Some(level), Some(name)) = (info.args.remove(0).into_int32(), info.args.remove(0).into_string()) { let level = match level.value() { @@ -267,9 +270,14 @@ fn build_log_fun(isolate: &v8::Isolate, outer_context: &v8::Context) -> v8::valu log!(level, "{}: {}", name, args); } - v8::value::undefined(&isolate).into() + Ok(v8::value::undefined(&isolate).into()) } else { - v8::value::undefined(&isolate).into() + let message = v8::value::String::from_str(&isolate, + &format!("log() called with bad \ + arguments, the first two \ + arguments should be an int and \ + a string")); + Err(v8::value::Exception::error(&isolate, &message).into()) } })) } @@ -285,19 +293,27 @@ fn build_require(isolate: &v8::Isolate, outer_context: &v8::Context) -> v8::valu Box::new(move |mut info| { let isolate = info.isolate; if info.args.len() < 1 { - v8::value::undefined(&isolate).into() + let message = v8::value::String::from_str(&isolate, + "require() called without any arguments"); + Err(v8::value::Exception::error(&isolate, &message).into()) } else if let Some(required_name) = info.args.remove(0).into_string() { let required_name = required_name.value(); for &(name, source) in MODULES.iter() { if name == required_name { - return load_module(&isolate, &context, &module_cache, name, source); + return Ok(load_module(&isolate, &context, &module_cache, name, source)); } } - v8::value::undefined(&isolate).into() + let message = v8::value::String::from_str(&isolate, + &format!("module not found: {:?}", + required_name)); + Err(v8::value::Exception::error(&isolate, &message).into()) } else { - v8::value::undefined(&isolate).into() + let message = v8::value::String::from_str(&isolate, + "require() called with a non-string \ + argument"); + Err(v8::value::Exception::error(&isolate, &message).into()) } })) } diff --git a/src/query/mod.rs b/src/query/mod.rs index d829632c..725c997e 100644 --- a/src/query/mod.rs +++ b/src/query/mod.rs @@ -288,7 +288,8 @@ mod test { #[test] fn parse_process_js_arg_nested_parens() { let expected = Query(vec![Process("map".to_owned(), - vec![Expression::Javascript("x => Math.floor(x)".to_owned())])]); + vec![Expression::Javascript("x => Math.floor(x)" + .to_owned())])]); let actual = Query::parse("map (x => Math.floor(x))").unwrap(); assert_eq!(expected, actual); diff --git a/src/value/toml.rs b/src/value/toml.rs index 1cd83ab3..9b0696ab 100644 --- a/src/value/toml.rs +++ b/src/value/toml.rs @@ -59,10 +59,10 @@ impl value::Sink for TomlSink let mut e = toml::Encoder::new(); match serde::Serialize::serialize(&value, &mut e) { Ok(()) => (), - Err(toml::Error::NeedsKey) => - return Err("TOML document needs to have a table at the root".into()), - Err(e) => - return Err(e.into()), + Err(toml::Error::NeedsKey) => { + return Err("TOML document needs to have a table at the root".into()) + }, + Err(e) => return Err(e.into()), } match panic::catch_unwind(move || toml::Value::Table(e.toml).to_string()) { @@ -76,7 +76,7 @@ impl value::Sink for TomlSink // rethrow otherwise panic::resume_unwind(cause); - } + }, } try!(self.0.write_all(b"\n"));