Skip to content

Commit

Permalink
Add bindings to eval in the ffi module.
Browse files Browse the repository at this point in the history
  • Loading branch information
ticki committed Oct 2, 2016
1 parent d3fbf89 commit e8eacfc
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/ffi/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
//! JavaScript FFI.
use prelude::*;

/// The integer type of JavaScript.
type Int = u32;

mod object;

/// Evaluate arbitrary JavaScript code.
///
/// # Safety
///
/// You can break invariants, and thus it's marked `unsafe`.
pub unsafe fn eval(js: &JsString) {
asm!("eval(__ObjectPool[$0])"
:: "r"(js.get_inner_object().get_id()));
}

0 comments on commit e8eacfc

Please sign in to comment.