2018-08-17 16:34:30 -04:00
|
|
|
// Copyright 2018 the Deno authors. All rights reserved. MIT license.
|
2018-09-04 18:56:12 -04:00
|
|
|
use libdeno;
|
2018-08-17 16:34:30 -04:00
|
|
|
use std::ffi::CStr;
|
|
|
|
|
2018-11-12 11:52:00 -05:00
|
|
|
// TODO Extract this version string from Cargo.toml.
|
2018-11-30 18:28:15 -05:00
|
|
|
pub const DENO: &str = "0.2.1";
|
2018-08-17 16:34:30 -04:00
|
|
|
|
2018-11-04 22:21:21 -08:00
|
|
|
pub fn v8() -> &'static str {
|
|
|
|
let version = unsafe { libdeno::deno_v8_version() };
|
|
|
|
let c_str = unsafe { CStr::from_ptr(version) };
|
2018-11-04 06:04:24 -08:00
|
|
|
c_str.to_str().unwrap()
|
2018-08-17 16:34:30 -04:00
|
|
|
}
|