servo / rust-mozjs

DEPRECATED - moved to servo/mozjs instead.
Mozilla Public License 2.0
293 stars 122 forks source link

Add function to tell whether a TypedArray underlying buffer is shared #438

Closed ferjm closed 6 years ago

ferjm commented 6 years ago

This change is Reviewable

ferjm commented 6 years ago

r? @jdm

jdm commented 6 years ago

r=me with the unsafe removed.

ferjm commented 6 years ago

I knew I added it for a reason :)

❯ cargo build
warning: src/jsglue.cpp:586:5: warning: delete called on non-final 'JS::OwningCompileOptions' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
warning:     delete static_cast<JS::OwningCompileOptions *>(aOpts);
warning:     ^
warning: 1 warning generated.
   Compiling mozjs v0.9.0 (file:///Users/ferjm/dev/mozilla/rust-mozjs)
error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
   --> src/typedarray.rs:214:9
    |
214 |         JS_GetTypedArraySharedness(self.object.as_raw())
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
    |
    = note: consult the function's documentation for information on how to avoid undefined behavior

error: aborting due to previous error

For more information about this error, try `rustc --explain E0133`.
The following warnings were emitted during compilation:

warning: src/jsglue.cpp:586:5: warning: delete called on non-final 'JS::OwningCompileOptions' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
warning:     delete static_cast<JS::OwningCompileOptions *>(aOpts);
warning:     ^
warning: 1 warning generated.

error: Could not compile `mozjs`.

To learn more, run the command again with --verbose.
jdm commented 6 years ago

@bors-servo r+

bors-servo commented 6 years ago

:pushpin: Commit 33fb3c9 has been approved by jdm

bors-servo commented 6 years ago

:hourglass: Testing commit 33fb3c93994ee1e54b3771832017b9cb7df8867c with merge 3efd159192e1c7237b48d8b614e8e906eac7c171...

bors-servo commented 6 years ago

:sunny: Test successful - status-appveyor, status-travis Approved by: jdm Pushing 3efd159192e1c7237b48d8b614e8e906eac7c171 to master...

ferjm commented 6 years ago

@jdm could you publish a new release with this change, please?

jdm commented 6 years ago

Done.

ferjm commented 6 years ago

Thanks!