File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 55/*global $hash$ installedModules $require$ hotDownloadManifest hotDownloadUpdateChunk modules */
66module . exports = function ( ) {
77
8+ // Copied from https://github.com/facebook/react/blob/bef45b0/src/shared/utils/canDefineProperty.js
9+ var canDefineProperty = false ;
10+ try {
11+ Object . defineProperty ( { } , "x" , {
12+ get : function ( ) { }
13+ } ) ;
14+ canDefineProperty = true ;
15+ } catch ( x ) {
16+ // IE will fail on defineProperty
17+ }
18+
819 var hotApplyOnUpdate = true ;
920 var hotCurrentHash = $hash$ ; // eslint-disable-line no-unused-vars
1021 var hotCurrentModuleData = { } ;
@@ -29,7 +40,7 @@ module.exports = function() {
2940 } ;
3041 for ( var name in $require$ ) {
3142 if ( Object . prototype . hasOwnProperty . call ( $require$ , name ) ) {
32- if ( Object . defineProperty ) {
43+ if ( canDefineProperty ) {
3344 Object . defineProperty ( fn , name , ( function ( name ) {
3445 return {
3546 configurable : true ,
@@ -72,7 +83,7 @@ module.exports = function() {
7283 }
7384 } ) ;
7485 }
75- if ( Object . defineProperty ) {
86+ if ( canDefineProperty ) {
7687 Object . defineProperty ( fn , "e" , {
7788 enumerable : true ,
7889 value : ensure
You can’t perform that action at this time.
0 commit comments