Alex Crichton 0b08bba0c7 Use static accessors if possible to get global object
Previously we always used `Function('return this')` but this triggers
CSP errors since it's basically `eval`. Instead this adds a few
preflight checks to look for objects like `globalThis`, `self`, etc.
Currently we don't have a `#[wasm_bindgen]` function annotation to
import a bare global field like `self`, but we test accesses with
`self.self` and `globalThis.globalThis`, catching errors to handle any
issues.

Closes #1641
2019-07-08 13:28:06 -07:00
..
2019-06-19 11:14:37 -07:00
2019-06-19 11:14:37 -07:00
2019-06-19 11:14:37 -07:00
2019-06-19 11:14:37 -07:00
2019-06-19 11:14:37 -07:00
2019-06-19 11:14:37 -07:00
2019-06-19 11:14:37 -07:00
2019-06-19 11:14:37 -07:00
2018-11-27 12:07:59 -08:00
2019-06-13 08:30:06 -07:00
2019-06-19 11:14:37 -07:00
2019-06-19 11:14:37 -07:00