commandline_frame.ts: Fix exception thrown because of 'tri' not existing

The commandline_frame document does not have a window.tri object. This
makes the commandline throw an exception on page load. We fix this by
using 'window.tri || {}' in order to avoid to avoid issues should
'window.tri' be defined in the command line one day.
This commit is contained in:
glacambre 2018-10-10 16:21:33 +02:00
parent 8744d73423
commit f51e08d9eb
No known key found for this signature in database
GPG key ID: B9625DB1767553AC

View file

@ -399,6 +399,6 @@ Messaging.addListener("commandline_frame", Messaging.attributeCaller(SELF))
// object since there's apparently a bug that causes performance
// observers to be GC'd even if they're still the target of a
// callback.
;(window as any).tri = Object.assign(window.tri, {
;(window as any).tri = Object.assign(window.tri || {}, {
perfObserver: perf.listenForCounters(),
})