File tree Expand file tree Collapse file tree 4 files changed +16
-7
lines changed Expand file tree Collapse file tree 4 files changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -438,7 +438,7 @@ function trySelf(parentPath, request) {
438438const EXPORTS_PATTERN = / ^ ( (?: @ [ ^ / \\ % ] + \/ ) ? [ ^ . / \\ % ] [ ^ / \\ % ] * ) ( \/ .* ) ? $ / ;
439439function resolveExports ( nmPath , request ) {
440440 // The implementation's behavior is meant to mirror resolution in ESM.
441- const [ , name , expansion = '' ] =
441+ const { 1 : name , 2 : expansion = '' } =
442442 StringPrototypeMatch ( request , EXPORTS_PATTERN ) || [ ] ;
443443 if ( ! name )
444444 return ;
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ const {
1212 PromisePrototypeCatch,
1313 ReflectApply,
1414 RegExpPrototypeTest,
15+ SafeArrayIterator,
1516 SafeSet,
1617 StringPrototypeIncludes,
1718 StringPrototypeMatch,
@@ -76,9 +77,9 @@ class ModuleJob {
7677 } ) ;
7778
7879 if ( promises !== undefined )
79- await PromiseAll ( promises ) ;
80+ await PromiseAll ( new SafeArrayIterator ( promises ) ) ;
8081
81- return PromiseAll ( dependencyJobs ) ;
82+ return PromiseAll ( new SafeArrayIterator ( dependencyJobs ) ) ;
8283 } ;
8384 // Promise for the list of all dependencyJobs.
8485 this . linked = link ( ) ;
@@ -106,8 +107,8 @@ class ModuleJob {
106107 }
107108 jobsInGraph . add ( moduleJob ) ;
108109 const dependencyJobs = await moduleJob . linked ;
109- return PromiseAll (
110- ArrayPrototypeMap ( dependencyJobs , addJobsToDependencyGraph ) ) ;
110+ return PromiseAll ( new SafeArrayIterator (
111+ ArrayPrototypeMap ( dependencyJobs , addJobsToDependencyGraph ) ) ) ;
111112 } ;
112113 await addJobsToDependencyGraph ( this ) ;
113114
Original file line number Diff line number Diff line change @@ -263,6 +263,9 @@ primordials.SafeWeakSet = makeSafe(
263263// Refs: https://tc39.es/ecma262/#sec-%typedarray%-intrinsic-object
264264[
265265 { name : 'TypedArray' , original : Reflect . getPrototypeOf ( Uint8Array ) } ,
266+ { name : 'ArrayIterator' , original : {
267+ prototype : Reflect . getPrototypeOf ( Array . prototype [ Symbol . iterator ] ( ) ) ,
268+ } } ,
266269 { name : 'StringIterator' , original : {
267270 prototype : Reflect . getPrototypeOf ( String . prototype [ Symbol . iterator ] ( ) ) ,
268271 } } ,
@@ -274,6 +277,10 @@ primordials.SafeWeakSet = makeSafe(
274277 copyPrototype ( original . prototype , primordials , `${ name } Prototype` ) ;
275278} ) ;
276279
280+ primordials . SafeArrayIterator = createSafeIterator (
281+ primordials . ArrayPrototypeSymbolIterator ,
282+ primordials . ArrayIteratorPrototypeNext
283+ ) ;
277284primordials . SafeStringIterator = createSafeIterator (
278285 primordials . StringPrototypeSymbolIterator ,
279286 primordials . StringIteratorPrototypeNext
Original file line number Diff line number Diff line change 66 ObjectDefineProperty,
77 RegExp,
88 RegExpPrototypeTest,
9+ SafeArrayIterator,
910 StringPrototypeToUpperCase
1011} = primordials ;
1112
@@ -78,15 +79,15 @@ function debuglog(set, cb) {
7879 debug = debuglogImpl ( enabled , set ) ;
7980 if ( typeof cb === 'function' )
8081 cb ( debug ) ;
81- debug ( ...args ) ;
82+ debug ( ...new SafeArrayIterator ( args ) ) ;
8283 } ;
8384 let enabled ;
8485 let test = ( ) => {
8586 init ( ) ;
8687 test = ( ) => enabled ;
8788 return enabled ;
8889 } ;
89- const logger = ( ...args ) => debug ( ...args ) ;
90+ const logger = ( ...args ) => debug ( ...new SafeArrayIterator ( args ) ) ;
9091 ObjectDefineProperty ( logger , 'enabled' , {
9192 get ( ) {
9293 return test ( ) ;
You can’t perform that action at this time.
0 commit comments