Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the improved JSVal interfaces. #1868

Merged
merged 4 commits into from Mar 10, 2014
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Next

Move JSVal into the jsval module.

  • Loading branch information
Ms2ger committed Mar 8, 2014
commit 9fbfb1909cde6225279730f123f312c270155d19
@@ -3,8 +3,9 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

use dom::bindings::utils::Reflectable;
use js::jsapi::{JSContext, JSObject, JS_WrapObject, JSVal, JS_ObjectIsCallable};
use js::jsapi::{JSContext, JSObject, JS_WrapObject, JS_ObjectIsCallable};
use js::jsapi::{JS_GetProperty, JSTracer, JS_CallTracer};
use js::jsval::JSVal;
use js::{JSVAL_IS_OBJECT, JSVAL_TO_OBJECT, JSTRACE_OBJECT};

use std::cast;
@@ -5246,7 +5246,8 @@ def makeEnumTypedef(e):
'js::jsapi::{JSClass, JSFreeOp, JSFunctionSpec, JSHandleObject, jsid}',
'js::jsapi::{JSNativeWrapper, JSObject, JSPropertyDescriptor}',
'js::jsapi::{JSPropertyOpWrapper, JSPropertySpec}',
'js::jsapi::{JSStrictPropertyOpWrapper, JSString, JSTracer, JSVal}',
'js::jsapi::{JSStrictPropertyOpWrapper, JSString, JSTracer}',
'js::jsval::JSVal',
'js::glue::{CallJitMethodOp, CallJitPropertyOp, CreateProxyHandler}',
'js::glue::{GetProxyPrivate, NewProxyObject, ProxyTraps}',
'js::glue::{RUST_BOOLEAN_TO_JSVAL, RUST_FUNCTION_VALUE_TO_JITINFO}',
@@ -6443,7 +6444,8 @@ def UnionConversions(config):
'js::jsapi::{JSClass, JSFreeOp, JSFunctionSpec, JSHandleObject, jsid}',
'js::jsapi::{JSNativeWrapper, JSObject, JSPropertyDescriptor}',
'js::jsapi::{JSPropertyOpWrapper, JSPropertySpec}',
'js::jsapi::{JSStrictPropertyOpWrapper, JSString, JSTracer, JSVal}',
'js::jsapi::{JSStrictPropertyOpWrapper, JSString, JSTracer}',
'js::jsval::JSVal',
'js::glue::{CallJitMethodOp, CallJitPropertyOp, CreateProxyHandler}',
'js::glue::{GetProxyPrivate, NewProxyObject, ProxyTraps}',
'js::glue::{RUST_BOOLEAN_TO_JSVAL, RUST_FUNCTION_VALUE_TO_JITINFO}',
@@ -2,10 +2,11 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

use js::jsapi::{JSVal, JSBool, JSContext};
use js::jsapi::{JSBool, JSContext};
use js::jsapi::{JS_ValueToUint64, JS_ValueToInt64};
use js::jsapi::{JS_ValueToECMAUint32, JS_ValueToECMAInt32};
use js::jsapi::{JS_ValueToUint16, JS_ValueToNumber, JS_ValueToBoolean};
use js::jsval::JSVal;
use js::{JSVAL_FALSE, JSVAL_TRUE, JSVAL_NULL};
use js::glue::{RUST_INT_TO_JSVAL, RUST_UINT_TO_JSVAL, RUST_JS_NumberValue};
use js::glue::{RUST_JSVAL_IS_NULL, RUST_JSVAL_IS_VOID};
@@ -30,11 +30,12 @@ use js::jsapi::{JS_HasPropertyById, JS_GetPrototype, JS_GetGlobalForObject};
use js::jsapi::{JS_NewUCStringCopyN, JS_DefineFunctions, JS_DefineProperty};
use js::jsapi::{JS_ValueToString, JS_GetReservedSlot, JS_SetReservedSlot};
use js::jsapi::{JSContext, JSObject, JSBool, jsid, JSClass, JSNative};
use js::jsapi::{JSFunctionSpec, JSPropertySpec, JSVal, JSPropertyDescriptor};
use js::jsapi::{JSFunctionSpec, JSPropertySpec, JSPropertyDescriptor};
use js::jsapi::{JS_NewGlobalObject, JS_InitStandardClasses};
use js::jsapi::{JSString};
use js::jsapi::{JS_AllowGC, JS_InhibitGC};
use js::jsfriendapi::bindgen::JS_NewObjectWithUniqueType;
use js::jsval::JSVal;
use js::{JSPROP_ENUMERATE, JSVAL_NULL, JSCLASS_IS_GLOBAL, JSCLASS_IS_DOMJSCLASS};
use js::{JSPROP_PERMANENT, JSID_VOID, JSPROP_NATIVE_ACCESSORS, JSPROP_GETTER};
use js::{JSPROP_SETTER, JSVAL_VOID, JSVAL_TRUE, JSVAL_FALSE};
@@ -43,7 +44,7 @@ use js;

mod jsval {
use js::glue::{RUST_JSVAL_IS_NULL, RUST_JSVAL_IS_VOID};
use js::jsapi::JSVal;
use js::jsval::JSVal;

pub fn is_null(v: JSVal) -> bool {
unsafe { RUST_JSVAL_IS_NULL(v) == 1 }
@@ -10,7 +10,8 @@ use dom::document::Document;
use dom::element::{Element, ElementTypeId, HTMLElementTypeId};
use dom::eventtarget::{EventTarget, NodeTargetTypeId};
use dom::node::{Node, ElementNodeTypeId};
use js::jsapi::{JSContext, JSVal};
use js::jsapi::JSContext;
use js::jsval::JSVal;
use js::JSVAL_NULL;
use servo_util::namespace;
use servo_util::str::DOMString;
@@ -9,7 +9,8 @@ use dom::window::Window;
use servo_util::str::DOMString;

use js::JSVAL_NULL;
use js::jsapi::{JSVal, JSContext};
use js::jsapi::JSContext;
use js::jsval::JSVal;

#[deriving(Encodable)]
pub struct TestBinding {
@@ -20,7 +20,8 @@ use servo_util::str::DOMString;
use servo_util::task::{spawn_named};

use js::glue::*;
use js::jsapi::{JSObject, JSContext, JS_DefineProperty, JSVal};
use js::jsapi::{JSObject, JSContext, JS_DefineProperty};
use js::jsval::JSVal;
use js::{JSVAL_NULL, JSPROP_ENUMERATE};

use std::cast;
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.