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

start tidying #255

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Fix all tidy errors except licenses and line lengths

  • Loading branch information
edunham committed Apr 19, 2016
commit fe43203c5632b9d444cc27384516be8d01bf2a3a
15 gen.py
@@ -2,29 +2,30 @@
# 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/.

import argparse, subprocess;
import subprocess

bindgen = "bindgen";
bindgen = "bindgen"

jsapi = "../mozjs/js/src/jsapi.h"
includes = [
"-I", "../mozjs/js/src/dist/include",
]
]
sysincludes = [
"-isystem", "/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5/include",
"-isystem", "/usr/lib/gcc/x86_64-redhat-linux/4.7.0/include",
]
]

args = [
bindgen,
"-l", "mozjs",
"-o", "jsapi.rs",
"-match" ,"js",
jsapi]
"-match", "js",
jsapi
]
args += includes + sysincludes

subprocess.call(args)

# To generate jsglue:
# DYLD_LIBRARY_PATH=~/versioned/rust-mozilla/build/llvm/x86_64-apple-darwin/Release+Asserts/lib/ ~/versioned/rust-bindgen/bindgen ./jsglue.c -I ../../build/src/mozjs/dist/include/ -match glue > glue.rs

@@ -31,16 +31,16 @@ use JSPROP_ENUMERATE;
use error::throw_type_error;
use glue::RUST_JS_NumberValue;
use jsapi::{JSContext, JSObject, JSString, HandleValue, MutableHandleValue};
use jsapi::{JS_NewUCStringCopyN, JS_StringHasLatin1Chars, JS_WrapValue};
use jsapi::{JS_GetArrayLength, JS_GetElement};
use jsapi::{JS_GetLatin1StringCharsAndLength, JS_GetTwoByteStringCharsAndLength};
use jsapi::{JS_NewArrayObject1, JS_DefineElement, RootedValue, RootedObject};
use jsapi::{JS_GetArrayLength, JS_GetElement};
use jsapi::{JS_NewUCStringCopyN, JS_StringHasLatin1Chars, JS_WrapValue};
use jsval::{BooleanValue, Int32Value, NullValue, UInt32Value, UndefinedValue};
use jsval::{JSVal, ObjectValue, ObjectOrNullValue, StringValue};
use rust::{ToBoolean, ToNumber, ToUint16, ToInt32, ToUint32, ToInt64, ToUint64, ToString};
use libc;
use num::Float;
use num::traits::{Bounded, Zero};
use rust::{ToBoolean, ToNumber, ToUint16, ToInt32, ToUint32, ToInt64, ToUint64, ToString};
use std::rc::Rc;
use std::{ptr, slice};

@@ -1,6 +1,6 @@
use libc::{size_t, intptr_t, uintptr_t, ptrdiff_t, FILE};
use std::marker::PhantomData;
use std::cell::UnsafeCell;
use std::marker::PhantomData;

pub enum va_list { }
pub enum JSPrincipals { }
@@ -1,6 +1,6 @@
use libc::{size_t, intptr_t, uintptr_t, ptrdiff_t, FILE};
use std::marker::PhantomData;
use std::cell::UnsafeCell;
use std::marker::PhantomData;

pub enum va_list { }
pub enum JSPrincipals { }
@@ -1,6 +1,6 @@
use libc::{size_t, intptr_t, uintptr_t, ptrdiff_t, FILE};
use std::marker::PhantomData;
use std::cell::UnsafeCell;
use std::marker::PhantomData;

pub enum va_list { }
pub enum JSPrincipals { }
@@ -1,6 +1,6 @@
use libc::{size_t, intptr_t, uintptr_t, ptrdiff_t, FILE};
use std::marker::PhantomData;
use std::cell::UnsafeCell;
use std::marker::PhantomData;

pub enum va_list { }
pub enum JSPrincipals { }
@@ -2,12 +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 jsapi::{JSObject, JSString, JSGCTraceKind};
use jsapi::JSGCTraceKind::{JSTRACE_OBJECT, JSTRACE_STRING};
use jsapi::JSValueType;
use jsapi::Value;
use jsapi::jsval_layout;
use jsapi::JSValueType;

use jsapi::{JSObject, JSString, JSGCTraceKind};
use libc::c_void;
use std::mem;

@@ -4,55 +4,53 @@

//! Rust wrappers around the raw JS apis

use libc::{size_t, c_uint, c_char, ptrdiff_t};
use std::char;
use std::ffi;
use std::ptr;
use std::slice;
use std::mem;
use std::u32;
use std::default::Default;
use std::intrinsics::return_address;
use std::ops::{Deref, DerefMut};
use std::cell::UnsafeCell;
use std::marker::PhantomData;
use consts::{JSCLASS_RESERVED_SLOTS_MASK, JSCLASS_RESERVED_SLOTS_SHIFT};
use consts::{JSCLASS_GLOBAL_SLOT_COUNT, JSCLASS_IS_GLOBAL};
use jsapi::{JS_NewContext, JS_DestroyContext, JS_NewRuntime, JS_DestroyRuntime};
use jsapi::{JSContext, JSRuntime, JSObject, JSFlatString, JSFunction, JSString, Symbol, JSScript,
jsid, Value};
use jsapi::{RuntimeOptionsRef, ContextOptionsRef, ReadOnlyCompileOptions};
use jsapi::{JS_SetErrorReporter, Evaluate3, JSErrorReport};
use jsapi::{JS_SetGCParameter, JSGCParamKey};
use jsapi::{Heap, Cell, HeapCellPostBarrier, HeapCellRelocate, HeapValuePostBarrier,
HeapValueRelocate};
use jsapi::{ThingRootKind, ContextFriendFields};
use jsapi::{CustomAutoRooter, AutoGCRooter, _vftable_CustomAutoRooter, AutoGCRooter_enum0};
use jsapi::{Rooted, RootedValue, Handle, MutableHandle, MutableHandleBase, RootedBase};
use jsapi::{MutableHandleValue, HandleValue, HandleObject, HandleBase};
use consts::{JSCLASS_RESERVED_SLOTS_MASK, JSCLASS_RESERVED_SLOTS_SHIFT};
use default_heapsize;
use default_stacksize;
use glue::{CreateAutoObjectVector, AppendToAutoObjectVector, DeleteAutoObjectVector};
use glue::{NewCompileOptions, DeleteCompileOptions};
use jsapi::AutoObjectVector;
use jsapi::{ToBooleanSlow, ToNumberSlow, ToStringSlow};
use jsapi::{ToInt32Slow, ToUint32Slow, ToUint16Slow, ToInt64Slow, ToUint64Slow};
use jsapi::{JSAutoRequest, JS_BeginRequest, JS_EndRequest};
use jsapi::{JSAutoCompartment, JS_EnterCompartment, JS_LeaveCompartment};
use jsapi::{JSJitMethodCallArgs, JSJitGetterCallArgs, JSJitSetterCallArgs, CallArgs};
use jsapi::{NullHandleValue, UndefinedHandleValue, JSID_VOID};
use jsapi::{CallArgsBase, CallReceiverBase, IncludeUsedRval, UsedRvalBase};
use jsapi::CompartmentOptions;
use jsapi::JS_DefineFunctions;
use jsapi::JS_DefineProperties;
use jsapi::JSClass;
use jsapi::JSFunctionSpec;
use jsapi::JSNativeWrapper;
use jsapi::JSPropertySpec;
use jsapi::PropertyDefinitionBehavior;
use jsapi::JS_SetNativeStackQuota;
use jsapi::JSClass;
use jsapi::JS_DefineFunctions;
use jsapi::JS_DefineProperties;
use jsapi::JS_GlobalObjectTraceHook;
use jsapi::JS_SetNativeStackQuota;
use jsapi::PropertyDefinitionBehavior;
use jsapi::{CallArgsBase, CallReceiverBase, IncludeUsedRval, UsedRvalBase};
use jsapi::{CustomAutoRooter, AutoGCRooter, _vftable_CustomAutoRooter, AutoGCRooter_enum0};
use jsapi::{Heap, Cell, HeapCellPostBarrier, HeapCellRelocate, HeapValuePostBarrier, HeapValueRelocate};
use jsapi::{JSAutoCompartment, JS_EnterCompartment, JS_LeaveCompartment};
use jsapi::{JSAutoRequest, JS_BeginRequest, JS_EndRequest};
use jsapi::{JSContext, JSRuntime, JSObject, JSFlatString, JSFunction, JSString, Symbol, JSScript, jsid, Value};
use jsapi::{JSJitMethodCallArgs, JSJitGetterCallArgs, JSJitSetterCallArgs, CallArgs};
use jsapi::{JS_NewContext, JS_DestroyContext, JS_NewRuntime, JS_DestroyRuntime};
use jsapi::{JS_SetErrorReporter, Evaluate3, JSErrorReport};
use jsapi::{JS_SetGCParameter, JSGCParamKey};
use jsapi::{MutableHandleValue, HandleValue, HandleObject, HandleBase};
use jsapi::{NullHandleValue, UndefinedHandleValue, JSID_VOID};
use jsapi::{Rooted, RootedValue, Handle, MutableHandle, MutableHandleBase, RootedBase};
use jsapi::{RuntimeOptionsRef, ContextOptionsRef, ReadOnlyCompileOptions};
use jsapi::{ThingRootKind, ContextFriendFields};
use jsapi::{ToBooleanSlow, ToNumberSlow, ToStringSlow};
use jsapi::{ToInt32Slow, ToUint32Slow, ToUint16Slow, ToInt64Slow, ToUint64Slow};
use jsval::UndefinedValue;
use glue::{CreateAutoObjectVector, AppendToAutoObjectVector, DeleteAutoObjectVector};
use glue::{NewCompileOptions, DeleteCompileOptions};
use default_stacksize;
use default_heapsize;
use libc::{size_t, c_uint, c_char, ptrdiff_t};
use std::cell::UnsafeCell;
use std::char;
use std::default::Default;
use std::ffi;
use std::intrinsics::return_address;
use std::marker::PhantomData;
use std::mem;
use std::ops::{Deref, DerefMut};
use std::ptr;
use std::slice;
use std::u32;

// From Gecko:
// Our "default" stack is what we use in configurations where we don't have a compelling reason to
@@ -3,7 +3,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

use jsapi::JSTracer;

use serialize::Encoder;

impl Encoder<()> for JSTracer {
@@ -20,7 +20,6 @@ use js::jsapi::Rooted;
use js::jsapi::Value;
use js::jsval::UndefinedValue;
use js::rust::{Runtime, SIMPLE_GLOBAL_CLASS};

use std::ffi::CStr;
use std::ptr;
use std::str;
@@ -12,7 +12,6 @@ use js::jsapi::JS_NewGlobalObject;
use js::jsapi::OnNewGlobalHookOption;
use js::jsapi::RootedObject;
use js::rust::{Runtime, SIMPLE_GLOBAL_CLASS};

use std::ptr;

#[test]
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.