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 5
5
/*global $hash$ installedModules $require$ hotDownloadManifest hotDownloadUpdateChunk modules */
6
6
module . exports = function ( ) {
7
7
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
+
8
19
var hotApplyOnUpdate = true ;
9
20
var hotCurrentHash = $hash$ ; // eslint-disable-line no-unused-vars
10
21
var hotCurrentModuleData = { } ;
@@ -29,7 +40,7 @@ module.exports = function() {
29
40
} ;
30
41
for ( var name in $require$ ) {
31
42
if ( Object . prototype . hasOwnProperty . call ( $require$ , name ) ) {
32
- if ( Object . defineProperty ) {
43
+ if ( canDefineProperty ) {
33
44
Object . defineProperty ( fn , name , ( function ( name ) {
34
45
return {
35
46
configurable : true ,
@@ -72,7 +83,7 @@ module.exports = function() {
72
83
}
73
84
} ) ;
74
85
}
75
- if ( Object . defineProperty ) {
86
+ if ( canDefineProperty ) {
76
87
Object . defineProperty ( fn , "e" , {
77
88
enumerable : true ,
78
89
value : ensure
You can’t perform that action at this time.
0 commit comments