Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The current way we're testing if postMessage has been changed is no longer valid. Lodash has already changed the way they test agianst this, as it no longer works in blink (thow continiues to work in webkit) In chrome browser (Version 65.0.3325.181 (Official Build) (64-bit)) console type: ```js String(window.postMessage) === String(Object.hasOwnProperty).replace('hasOwnProperty', 'postMessage') ``` It still works in safari (Version 11.0.3 (13604.5.6)) A simplified version of how lodash are testing aginst it https://github.com/lodash/lodash/blob/4.0.1-npm-packages/lodash.isnative/index.js With a simpler description about this method can be found here: https://davidwalsh.name/detect-native-function Running: ```js RegExp('^' + String(Object.prototype.toString) .replace(/[.*+?^${}()|[\]\/\\]/g, '\\$&') .replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' ).test(String(window.postMessage)) ``` Works correctly in both chrome and safari. Affected issues: facebook#10865 - some hacks were seggested here to sidestep this issue. This PR should fix it outright
- Loading branch information