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 = '' } =
442442StringPrototypeMatch ( request , EXPORTS_PATTERN ) || [ ] ;
443443if ( ! name )
444444return ;
Original file line number Diff line number Diff line change 1212 PromisePrototypeCatch,
1313 ReflectApply,
1414 RegExpPrototypeTest,
15+ SafeArrayIterator,
1516 SafeSet,
1617 StringPrototypeIncludes,
1718 StringPrototypeMatch,
@@ -76,9 +77,9 @@ class ModuleJob{
7677} ) ;
7778
7879if ( 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.
8485this . linked = link ( ) ;
@@ -106,8 +107,8 @@ class ModuleJob{
106107}
107108jobsInGraph . add ( moduleJob ) ;
108109const dependencyJobs = await moduleJob . linked ;
109- return PromiseAll (
110- ArrayPrototypeMap ( dependencyJobs , addJobsToDependencyGraph ) ) ;
110+ return PromiseAll ( new SafeArrayIterator (
111+ ArrayPrototypeMap ( dependencyJobs , addJobsToDependencyGraph ) ) ) ;
111112} ;
112113await 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 : {
267270prototype : Reflect . getPrototypeOf ( String . prototype [ Symbol . iterator ] ( ) ) ,
268271} } ,
@@ -274,6 +277,10 @@ primordials.SafeWeakSet = makeSafe(
274277copyPrototype ( original . prototype , primordials , `${ name } Prototype` ) ;
275278} ) ;
276279
280+ primordials . SafeArrayIterator = createSafeIterator (
281+ primordials . ArrayPrototypeSymbolIterator ,
282+ primordials . ArrayIteratorPrototypeNext
283+ ) ;
277284primordials . SafeStringIterator = createSafeIterator (
278285primordials . StringPrototypeSymbolIterator ,
279286primordials . 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){
7879debug = debuglogImpl ( enabled , set ) ;
7980if ( typeof cb === 'function' )
8081cb ( debug ) ;
81- debug ( ...args ) ;
82+ debug ( ...new SafeArrayIterator ( args ) ) ;
8283} ;
8384let enabled ;
8485let test = ( ) => {
8586init ( ) ;
8687test = ( ) => enabled ;
8788return enabled ;
8889} ;
89- const logger = ( ...args ) => debug ( ...args ) ;
90+ const logger = ( ...args ) => debug ( ...new SafeArrayIterator ( args ) ) ;
9091ObjectDefineProperty ( logger , 'enabled' , {
9192get ( ) {
9293return test ( ) ;
You can’t perform that action at this time.
0 commit comments