Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sinonjs/sinon#1143: Only overwrite globals when running in IE #87

Merged
merged 4 commits into from
Nov 10, 2016

Conversation

mroderick
Copy link
Member

This is a PR for master, it is a solution for sinonjs/sinon#1143

The PR fixes compatibility with React Native and quite possibly other libraries.

To verify bug

  1. Run test in https://github.com/mroderick/sinon-issue-1143
  2. Observe that an error occurs
TypeError: Date is not a constructor

  at new MessageQueue (node_modules/react-native/Libraries/Utilities/MessageQueue.js:62:26)
  at Object.<anonymous> (node_modules/react-native/Libraries/BatchedBridge/BatchedBridge.js:17:19)
  at Object.<anonymous> (node_modules/react-native/Libraries/Utilities/RCTLog.js:14:19)
  at setUpConsole (node_modules/react-native/Libraries/JavaScriptAppEngine/Initialization/InitializeJavaScriptAppEngine.js:54:1)

To verify solution

  1. Check out this PR, switch into that folder
  2. npm link
  3. Switch back to your sinon-issue-1143 folder that you just used above
  4. cd node_modules/sinon/
  5. npm link lolex
  6. cd -
  7. npm test
  8. Observe that test test passes

@fatso83 fatso83 merged commit a9c9b7f into sinonjs:master Nov 10, 2016
@mroderick
Copy link
Member Author

Thanks

@mroderick mroderick deleted the only-overwrite-globals-in-ie branch November 10, 2016 08:53
@fatso83 fatso83 mentioned this pull request Aug 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants