aboutsummaryrefslogtreecommitdiffstats
path: root/support/magicleap/Servo2D/code/inc/Servo2D.h
diff options
context:
space:
mode:
authorCYBAI <cyb.ai.815@gmail.com>2019-08-08 12:29:06 +0900
committerCYBAI <cyb.ai.815@gmail.com>2019-08-08 12:39:56 +0900
commit28e64fc701fc4a5f2f2e2dafe841465fe87e036c (patch)
treed2a7d806579f6bd2e78cc977029354f9137f1577 /support/magicleap/Servo2D/code/inc/Servo2D.h
parent555fa75b2c7f4faa0818e86296a4ea3d5b8e4d42 (diff)
downloadservo-28e64fc701fc4a5f2f2e2dafe841465fe87e036c.tar.gz
servo-28e64fc701fc4a5f2f2e2dafe841465fe87e036c.zip
Assert incumbent global is always some in get_incumbent_global hook
While working on module script, I'd like to use Promise with a custom callback with type `Box<dyn TaskBox>` which means we didn't use web API callbacks as native handlers. However, we'll get a panic from `enqueue_promise_job` and the panic says we have a `null` incumbent global. The main problem here is, the Promise API is strongly tied to JS engine and it always assumes there's a meaningful answer for "what specific global is this promise associated with". So, when I don't use the Promise for a specific web API, our engine cannot find a proper incumbent global for us so that we get the `null` incumbent global panic. To make us catch this case easier in the future, we should add the assertion inside `get_incumbent_global` hook so that we can know this quickly next time. Ref: https://mozilla.logbot.info/servo/20190807#c16525481
Diffstat (limited to 'support/magicleap/Servo2D/code/inc/Servo2D.h')
0 files changed, 0 insertions, 0 deletions