Skip to content
This repository has been archived by the owner on Nov 12, 2022. It is now read-only.

Commit

Permalink
Tidy up
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan Jeffrey committed Jun 26, 2018
1 parent 5e43f6d commit 3ceb563
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 40 deletions.
28 changes: 1 addition & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,4 @@ Rust bindings to SpiderMonkey

[Documentation](http://doc.servo.org/mozjs/)

## Setting up your environment

### Rust

This project requires Rust nightly-2018-03-25 or greater.
For installation of the Rust toolchain see [`https://rustup.rs/`](https://rustup.rs/).

### Other dependencies

#### macOS
#### On macOS (Homebrew)

```sh
brew install automake pkg-config python2 cmake
```

## Building the project

```sh
cargo build
```

## Testing the project

```sh
cargo test
```
See https://github.com/servo/mozjs/blob/master/README.md for build instructions.
1 change: 0 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ fn main() {
if cfg!(target_os = "windows") {
build.flag(&format!("-FI{}", confdefs_path.to_string_lossy()));
build.define("WIN32", "");
build.define("XP_PC", "");
build.flag("-Zi");
build.flag("-GR-");
} else {
Expand Down
22 changes: 11 additions & 11 deletions src/jsglue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ GetSecurityWrapper()
JS::ReadOnlyCompileOptions*
NewCompileOptions(JSContext* aCx, const char* aFile, unsigned aLine)
{
JS::OwningCompileOptions *opts = new JS::OwningCompileOptions(aCx);
JS::OwningCompileOptions *opts = new JS::OwningCompileOptions(aCx);
opts->setFileAndLine(aCx, aFile, aLine);
return opts;
}
Expand Down Expand Up @@ -574,28 +574,28 @@ GetWindowProxyClass()
return &WindowProxyClass;
}

void
GetProxyReservedSlot(JSObject* obj, uint32_t slot, JS::Value* dest)
JSObject*
NewWindowProxy(JSContext* aCx, JS::HandleObject aObj, const void* aHandler)
{
*dest = js::GetProxyReservedSlot(obj, slot);
return WrapperNew(aCx, aObj, aHandler, Jsvalify(&WindowProxyClass), true);
}

void
SetProxyReservedSlot(JSObject* obj, uint32_t slot, const JS::Value* val)
GetProxyReservedSlot(JSObject* obj, uint32_t slot, JS::Value* dest)
{
js::SetProxyReservedSlot(obj, slot, *val);
*dest = js::GetProxyReservedSlot(obj, slot);
}

JSObject*
NewWindowProxy(JSContext* aCx, JS::HandleObject aObj, const void* aHandler)
void
GetProxyPrivate(JSObject* obj, JS::Value* dest)
{
return WrapperNew(aCx, aObj, aHandler, Jsvalify(&WindowProxyClass), true);
*dest = js::GetProxyPrivate(obj);
}

void
GetProxyPrivate(JSObject* obj, JS::Value* dest)
SetProxyReservedSlot(JSObject* obj, uint32_t slot, const JS::Value* val)
{
*dest = js::GetProxyPrivate(obj);
js::SetProxyReservedSlot(obj, slot, *val);
}

void
Expand Down
2 changes: 1 addition & 1 deletion src/rust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ impl Runtime {
assert!(!parent_runtime.is_null());
let old_runtime = PARENT.compare_and_swap(ptr::null_mut(), parent_runtime, Ordering::SeqCst);
assert!(old_runtime.is_null());
assert!(UseInternalJobQueues(js_context, false));
assert!(UseInternalJobQueues(js_context, false));
js_context
} else {
let parent_runtime = PARENT.load(Ordering::SeqCst);
Expand Down

0 comments on commit 3ceb563

Please sign in to comment.