mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Use this rather than global in prelude
Summary: in new-style builds, the prelude is not wrapped into an IIFE, so `global` is not available. Since the bundle as a whole is not running in strict mode, we can access the global object with `this`. Reviewed By: jeanlauliac Differential Revision: D5051731 fbshipit-source-id: 4003b5e57ba8626e38e68e92d5778c2c59ca69a5
This commit is contained in:
committed by
Facebook Github Bot
parent
0a4ce80868
commit
e1306565db
@@ -97,6 +97,6 @@ function* concat<T>(...iterables: Array<Iterable<T>>): Iterable<T> {
|
||||
function prelude(optimize) {
|
||||
return virtualModule(
|
||||
`var __DEV__=${String(!optimize)},` +
|
||||
'__BUNDLE_START_TIME__=global.nativePerformanceNow?global.nativePerformanceNow():Date.now();'
|
||||
'__BUNDLE_START_TIME__=this.nativePerformanceNow?nativePerformanceNow():Date.now();'
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user