mirror of https://github.com/status-im/metro.git
Unbreak console reassignment on iOS7
Summary: public Unbreaks console assignment on iOS7 introduced in #3322 Reviewed By: alexeylang Differential Revision: D2759689 fb-gh-sync-id: 28cccfdf1123245732fa5ba0337ee8d7bb43c822
This commit is contained in:
parent
174c573c86
commit
280cc2e807
|
@ -474,8 +474,14 @@
|
|||
trace: getNativeLogFunction(LOG_LEVELS.trace),
|
||||
table: consoleTablePolyfill
|
||||
};
|
||||
descriptor.value = console;
|
||||
Object.defineProperty(global, 'console', descriptor);
|
||||
|
||||
// don't reassign to the original descriptor. breaks on ios7
|
||||
Object.defineProperty(global, 'console', {
|
||||
value: console,
|
||||
configurable: descriptor ? descriptor.configurable : true,
|
||||
enumerable: descriptor ? descriptor.enumerable : true,
|
||||
writable: descriptor ? descriptor.writable : true,
|
||||
});
|
||||
|
||||
// If available, also call the original `console` method since that is
|
||||
// sometimes useful. Ex: on OS X, this will let you see rich output in
|
||||
|
|
Loading…
Reference in New Issue