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
9f48c004ba
commit
4cb04315e7
|
@ -474,8 +474,14 @@
|
||||||
trace: getNativeLogFunction(LOG_LEVELS.trace),
|
trace: getNativeLogFunction(LOG_LEVELS.trace),
|
||||||
table: consoleTablePolyfill
|
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
|
// 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
|
// sometimes useful. Ex: on OS X, this will let you see rich output in
|
||||||
|
|
Loading…
Reference in New Issue