mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
Avoid trying to trace a null JSVal.
JSVal::trace_kind() asserts that it is a markable type; null is a gcthing that is not markable.
This commit is contained in:
parent
0d202b6bda
commit
2d2674e346
2 changed files with 8 additions and 1 deletions
|
@ -68,7 +68,7 @@ pub trait JSTraceable {
|
|||
|
||||
/// Trace a `JSVal`.
|
||||
pub fn trace_jsval(tracer: *mut JSTracer, description: &str, val: JSVal) {
|
||||
if !val.is_gcthing() {
|
||||
if !val.is_markable() {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
7
src/test/content/test_trace_null.html
Normal file
7
src/test/content/test_trace_null.html
Normal file
|
@ -0,0 +1,7 @@
|
|||
<!-- crashtest -->
|
||||
<script src=harness.js></script>
|
||||
<script>
|
||||
new CustomEvent("foo", { detail: null });
|
||||
gc();
|
||||
finish();
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue