flowchart TB
JsValue
JsValue-->JsObject
subgraph primitives [Primitive Types]
JsBoolean
JsNumber
JsString
JsNull
JsUndefined
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"reason":"compiler-artifact","package_id":"proc-macro2 1.0.53 (registry+https://github.com/rust-lang/crates.io-index)","manifest_path":"/Users/dherman/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.53/Cargo.toml","target":{"kind":["custom-build"],"crate_types":["bin"],"name":"build-script-build","src_path":"/Users/dherman/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.53/build.rs","edition":"2018","doc":false,"doctest":false,"test":false},"profile":{"opt_level":"0","debuginfo":2,"debug_assertions":true,"overflow_checks":true,"test":false},"features":["proc-macro"],"filenames":["/Users/dherman/Sources/neon-prebuild-example/target/debug/build/proc-macro2-7bfb42c5b5753c49/build-script-build"],"executable":null,"fresh":true} | |
{"reason":"build-script-executed","package_id":"proc-macro2 1.0.53 (registry+https://github.com/rust-lang/crates.io-index)","linked_libs":[],"linked_paths":[],"cfgs":["use_proc_macro","wrap_proc_macro"],"env":[],"out_dir":"/Users/dherman/Sources/neon-prebuil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use neon::prelude::*; | |
use neon::types::buffer::TypedArray; | |
use linkify::{LinkFinder, LinkKind, Span}; | |
// Purely indexed version of Span<'t> that removes reference to the original string. | |
struct IndexSpan { | |
start: u32, | |
end: u32, | |
kind: u32, | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dherman@dherman-mn2 neon % npm test | |
> test | |
> npm run test:rust && npm run test:js | |
> test:rust | |
> cargo neon-test | |
Compiling neon v1.0.0-alpha.1 (/Users/dherman/Sources/neon/crates/neon) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* https://users.rust-lang.org/t/how-to-implement-index-range-usize-for-a-custom-slice-type-with-additional-data/66201 | |
* | |
* buffer.region(4, 16).into::<JsUint32Array> | |
* buffer.from(4).to(16).into::<JsUint32Array> | |
* buffer[4..16].to_typed_array::<u32, _>(&mut cx) | |
* JsUint32Array::from_region(&mut cx, buffer[4..16]) | |
* buffer.region(4..16).to_typed_array::<u32, _>(&mut cx) | |
* JsUint32Array::from_region(&mut cx, buffer.region(4..16)) | |
* JsUint32Array::from_buffer_region(&mut cx, buffer, 4, 16)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait TypedArrayExt { | |
fn set_info<'cx, C: Context<'cx>>(&self, cx: &mut C, info: Handle<'cx, JsObject>) -> NeonResult<()>; | |
fn get_info<'cx, C: Context<'cx>>(&self, cx: &mut C) -> JsResult<'cx, JsObject> { | |
let info = cx.empty_object(); | |
self.set_info(cx, info)?; | |
Ok(info) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
{ | |
let abp = ArrayBuffer.prototype; | |
const VIEW = Symbol('view'); | |
function getView(receiver) { | |
return receiver[VIEW] || | |
(receiver[VIEW] = new Uint8Array(receiver)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ATTRIBUTES = ['A', 'B', 'C', 'D', 'E', 'F']; | |
// type attribute = 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | |
// type value = "x" | "" | |
// type combo = [value] | |
function combos() { | |
return combosFrom(ATTRIBUTES, 0); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
. | |
├── ansi-escapes | |
│ ├── index.js | |
│ ├── license | |
│ ├── package.json | |
│ └── readme.md | |
├── ansi-escape-sequences | |
│ ├── jsdoc2md | |
│ │ └── README.hbs | |
│ ├── lib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"active": "release", | |
"targets": { | |
"release": { | |
"rustc": "rustc 1.26.0 (a77568041 2018-05-07)", | |
"env": { | |
"npm_config_target": null, | |
"npm_config_arch": null, | |
"npm_config_target_arch": null, | |
"npm_config_disturl": null, |
NewerOlder