88var runtime = ( function ( exports ) {
99 "use strict" ;
1010
11- var define = Object . defineProperty ;
1211 var Op = Object . prototype ;
1312 var hasOwn = Op . hasOwnProperty ;
1413 var undefined ; // More compressible than void 0.
@@ -17,13 +16,22 @@ var runtime = (function (exports) {
1716 var asyncIteratorSymbol = $Symbol . asyncIterator || "@@asyncIterator" ;
1817 var toStringTagSymbol = $Symbol . toStringTag || "@@toStringTag" ;
1918
20- if ( define ) {
21- try {
22- // IE 8 has a broken Object.defineProperty that only works on DOM objects
23- define ( { } , '' , { } ) ;
24- } catch ( err ) {
25- define = undefined ;
26- }
19+ function define ( obj , key , value ) {
20+ Object . defineProperty ( obj , key , {
21+ value : value ,
22+ enumerable : true ,
23+ configurable : true ,
24+ writable : true
25+ } ) ;
26+ return obj [ key ] ;
27+ }
28+ try {
29+ // IE 8 has a broken Object.defineProperty that only works on DOM objects.
30+ define ( { } , "" ) ;
31+ } catch ( err ) {
32+ define = function ( obj , key , value ) {
33+ return obj [ key ] = value ;
34+ } ;
2735 }
2836
2937 function wrap ( innerFn , outerFn , self , tryLocsList ) {
@@ -92,35 +100,23 @@ var runtime = (function (exports) {
92100 IteratorPrototype = NativeIteratorPrototype ;
93101 }
94102
95- function ensureDefaultToStringTag ( object , defaultValue ) {
96- // https://bugzilla.mozilla.org/show_bug.cgi?id=1644581#c6
97- return toStringTagSymbol in object
98- ? ( define && define ( object , toStringTagSymbol , {
99- value : defaultValue ,
100- enumerable : true ,
101- configurable : true ,
102- writable : true
103- } ) ,
104- defaultValue )
105- : object [ toStringTagSymbol ] = defaultValue ;
106- }
107-
108103 var Gp = GeneratorFunctionPrototype . prototype =
109104 Generator . prototype = Object . create ( IteratorPrototype ) ;
110105 GeneratorFunction . prototype = Gp . constructor = GeneratorFunctionPrototype ;
111106 GeneratorFunctionPrototype . constructor = GeneratorFunction ;
112- GeneratorFunction . displayName = ensureDefaultToStringTag (
107+ GeneratorFunction . displayName = define (
113108 GeneratorFunctionPrototype ,
109+ toStringTagSymbol ,
114110 "GeneratorFunction"
115111 ) ;
116112
117113 // Helper for defining the .next, .throw, and .return methods of the
118114 // Iterator interface in terms of a single ._invoke method.
119115 function defineIteratorMethods ( prototype ) {
120116 [ "next" , "throw" , "return" ] . forEach ( function ( method ) {
121- prototype [ method ] = function ( arg ) {
117+ define ( prototype , method , function ( arg ) {
122118 return this . _invoke ( method , arg ) ;
123- } ;
119+ } ) ;
124120 } ) ;
125121 }
126122
@@ -139,7 +135,7 @@ var runtime = (function (exports) {
139135 Object . setPrototypeOf ( genFun , GeneratorFunctionPrototype ) ;
140136 } else {
141137 genFun . __proto__ = GeneratorFunctionPrototype ;
142- ensureDefaultToStringTag ( genFun , "GeneratorFunction" ) ;
138+ define ( genFun , toStringTagSymbol , "GeneratorFunction" ) ;
143139 }
144140 genFun . prototype = Object . create ( Gp ) ;
145141 return genFun ;
@@ -409,7 +405,7 @@ var runtime = (function (exports) {
409405 // unified ._invoke helper method.
410406 defineIteratorMethods ( Gp ) ;
411407
412- ensureDefaultToStringTag ( Gp , "Generator" ) ;
408+ define ( Gp , toStringTagSymbol , "Generator" ) ;
413409
414410 // A Generator should always return itself as the iterator object when the
415411 // @@iterator function is called on it. Some browsers' implementations of the
0 commit comments