mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
alphabetized frozen supported entry types on the global, avoid moving Heap into Option
This commit is contained in:
parent
4f36472b6f
commit
e0b768c6cc
9 changed files with 66 additions and 49 deletions
|
@ -255,10 +255,13 @@ impl MessageEventMethods for MessageEvent {
|
|||
.collect();
|
||||
let frozen_ports = to_frozen_array(ports.as_slice(), cx);
|
||||
|
||||
// Cache the Js value.
|
||||
let heap_val = Heap::default();
|
||||
heap_val.set(frozen_ports);
|
||||
*self.frozen_ports.borrow_mut() = Some(heap_val);
|
||||
// Safety: need to create the Heap value in its final memory location before setting it.
|
||||
*self.frozen_ports.borrow_mut() = Some(Heap::default());
|
||||
self.frozen_ports
|
||||
.borrow()
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.set(frozen_ports);
|
||||
|
||||
frozen_ports
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue