Permalink
Browse files

s/import/use/g; fix class method syntax

  • Loading branch information...
1 parent 2f45a0e commit 1b97683c638153d98c8af50416d48efbcd9471e2 Brian J. Burg committed Sep 11, 2012
Showing with 27 additions and 27 deletions.
  1. +1 −1 crust.rs
  2. +4 −4 global.rs
  3. +1 −1 glue.rs
  4. +15 −15 js.rs
  5. +1 −1 jsapi.rs
  6. +2 −2 name_pool.rs
  7. +3 −3 rust.rs
View
@@ -1,4 +1,4 @@
-import jsapi::*;
+use jsapi::*;
extern fn JS_PropertyStub(++cx: *JSContext, ++obj: JSHandleObject, ++id: JSHandleId, ++vp: JSMutableHandleValue) -> JSBool {
bindgen::JS_PropertyStub(cx, obj, id, vp)
View
@@ -4,10 +4,10 @@ Handy functions for creating class objects and so forth.
"];
-import glue::bindgen::GetJSClassHookStubPointer;
-import glue::{PROPERTY_STUB, STRICT_PROPERTY_STUB, ENUMERATE_STUB,
+use glue::bindgen::GetJSClassHookStubPointer;
+use glue::{PROPERTY_STUB, STRICT_PROPERTY_STUB, ENUMERATE_STUB,
RESOLVE_STUB, CONVERT_STUB};
-import libc::c_uint;
+use libc::c_uint;
export basic_class;
export global_class;
export debug_fns;
@@ -51,7 +51,7 @@ unsafe fn jsval_to_rust_str(cx: *JSContext, vp: *jsapi::JSString) -> ~str {
}
extern fn debug(cx: *JSContext, argc: c_uint, vp: *jsval) -> JSBool {
- import io::WriterUtil;
+ use io::WriterUtil;
unsafe {
let argv = JS_ARGV(cx, vp);
View
@@ -1,6 +1,6 @@
/* automatically generated by rust-bindgen */
-import libc::*;
+use libc::*;
type enum_StubType = c_uint;
const PROPERTY_STUB: u32 = 0_u32;
View
30 js.rs
@@ -1,13 +1,13 @@
-import ptr::{null, addr_of};
-import result::{Result, Ok, Err};
-import libc::{c_char, c_uint};
-import name_pool::{name_pool, add};
-import str::unsafe::from_c_str;
-import io::WriterUtil;
-import jsapi::{JSBool, JSClass, JSContext, JSErrorReport, JSFunctionSpec,
+use ptr::{null, addr_of};
+use result::{Result, Ok, Err};
+use libc::{c_char, c_uint};
+use name_pool::{name_pool, add};
+use str::unsafe::from_c_str;
+use io::WriterUtil;
+use jsapi::{JSBool, JSClass, JSContext, JSErrorReport, JSFunctionSpec,
JSObject, JSRuntime, JSString, JSVERSION_LATEST, jsval,
JSPropertySpec, JSPropertyOp, JSStrictPropertyOp};
-import jsapi::bindgen::{JS_free, JS_AddObjectRoot, JS_DefineFunctions,
+use jsapi::bindgen::{JS_free, JS_AddObjectRoot, JS_DefineFunctions,
JS_DestroyContext, JS_EncodeString, JS_EvaluateScript,
JS_Finish, JS_GetContextPrivate, JS_GetPrivate,
JS_Init, JS_InitStandardClasses,
@@ -16,10 +16,10 @@ import jsapi::bindgen::{JS_free, JS_AddObjectRoot, JS_DefineFunctions,
JS_SetErrorReporter, JS_SetOptions, JS_SetPrivate,
JS_SetVersion, JS_ValueToString, JS_DefineProperties,
JS_DefineProperty, JS_NewObject, JS_ComputeThis};
-import libc::types::common::c99::{int8_t, int16_t, int32_t, int64_t, uint8_t,
+use libc::types::common::c99::{int8_t, int16_t, int32_t, int64_t, uint8_t,
uint16_t, uint32_t, uint64_t};
-import glue::bindgen::{RUST_JSVAL_TO_OBJECT, RUST_JSVAL_IS_PRIMITIVE};
-import rust::jsobj;
+use glue::bindgen::{RUST_JSVAL_TO_OBJECT, RUST_JSVAL_IS_PRIMITIVE};
+use rust::jsobj;
export JSOPTION_STRICT;
export JSOPTION_WERROR;
@@ -44,15 +44,15 @@ export crust;
export ptr_methods;
// These are just macros in jsapi.h
-import JS_NewRuntime = jsapi::bindgen::JS_Init;
+use JS_NewRuntime = jsapi::bindgen::JS_Init;
export JS_NewRuntime;
-import JS_DestroyRuntime = jsapi::bindgen::JS_Finish;
+use JS_DestroyRuntime = jsapi::bindgen::JS_Finish;
export JS_DestroyRuntime;
/*
FIXME: Not sure where JS_Lock is
-import JS_LockRuntime = jsapi::bindgen::JS_Lock;
+use JS_LockRuntime = jsapi::bindgen::JS_Lock;
export JS_LockRuntime;
-import JS_UnlockRuntime = jsapi::bindgen::JS_Unlock;
+use JS_UnlockRuntime = jsapi::bindgen::JS_Unlock;
export JS_UnlockRuntime;
*/
View
@@ -1,6 +1,6 @@
/* automatically generated by rust-bindgen */
-import libc::*;
+use libc::*;
type moz_static_assert0 = c_int;
View
@@ -1,5 +1,5 @@
-import libc::c_char;
-import vec::push;
+use libc::c_char;
+use vec::push;
export name_pool;
export methods;
View
@@ -1,8 +1,8 @@
#[doc = "Rust wrappers around the raw JS apis"];
-import bg = jsapi::bindgen;
-import libc::types::os::arch::c95::{size_t, c_uint};
-import std::map::{hashmap, str_hash};
+use bg = jsapi::bindgen;
+use libc::types::os::arch::c95::{size_t, c_uint};
+use std::map::{hashmap, str_hash};
export rt;
export cx;

0 comments on commit 1b97683

Please sign in to comment.