mirror of
https://github.com/status-im/react-native.git
synced 2025-01-09 09:12:02 +00:00
8891f22f88
Summary: event-target-shim versions before 1.1.0 do not support taking an array for `EventTarget`. react-native requires `^1.0.5`, so this fixes compatibility with those earlier versions. **Test Plan:** ran WebSocket UIExplorer example with earlier version of event-target-shim. Closes https://github.com/facebook/react-native/pull/7261 Differential Revision: D3230881 Pulled By: martinbigio fb-gh-sync-id: 6a22d58841a4b401a200fece64d13a70043fb09a fbshipit-source-id: 6a22d58841a4b401a200fece64d13a70043fb09a
19 lines
428 B
JavaScript
19 lines
428 B
JavaScript
// Jest fatals for the following statement (minimal repro case)
|
|
//
|
|
// exports.something = Symbol;
|
|
//
|
|
// Until it is fixed, mocking the entire node module makes the
|
|
// problem go away.
|
|
|
|
'use strict';
|
|
|
|
function EventTarget() {
|
|
// Support both EventTarget and EventTarget(...)
|
|
// as a super class, just like the original module does.
|
|
if (arguments.length > 0) {
|
|
return EventTarget;
|
|
}
|
|
}
|
|
|
|
module.exports = EventTarget;
|