@@ -319,7 +319,7 @@ func (f *Frame) document() (*ElementHandle, error) {
319
319
return f .documentHandle , nil
320
320
}
321
321
322
- f .waitForExecutionContext (mainExecutionContext )
322
+ f .waitForExecutionContext (mainWorld )
323
323
324
324
var (
325
325
result interface {}
@@ -346,9 +346,9 @@ func (f *Frame) hasContext(world string) bool {
346
346
defer f .executionContextMu .RUnlock ()
347
347
348
348
switch world {
349
- case mainExecutionContext :
349
+ case mainWorld :
350
350
return f .mainExecutionContext != nil
351
- case utilityExecutionContext :
351
+ case utilityWorld :
352
352
return f .utilityExecutionContext != nil
353
353
}
354
354
return false // Should never reach here!
@@ -461,11 +461,11 @@ func (f *Frame) setContext(world string, execCtx frameExecutionContext) {
461
461
f .ID (), f .URL (), execCtx .ID (), world )
462
462
463
463
switch world {
464
- case mainExecutionContext :
464
+ case mainWorld :
465
465
if f .mainExecutionContext == nil {
466
466
f .mainExecutionContext = execCtx
467
467
}
468
- case utilityExecutionContext :
468
+ case utilityWorld :
469
469
if f .utilityExecutionContext == nil {
470
470
f .utilityExecutionContext = execCtx
471
471
}
@@ -524,7 +524,7 @@ func (f *Frame) waitForFunction(apiCtx context.Context, world string, predicateF
524
524
defer f .executionContextMu .RUnlock ()
525
525
526
526
execCtx := f .mainExecutionContext
527
- if world == utilityExecutionContext {
527
+ if world == utilityWorld {
528
528
execCtx = f .utilityExecutionContext
529
529
}
530
530
injected , err := execCtx .getInjectedScript (apiCtx )
@@ -722,7 +722,7 @@ func (f *Frame) Evaluate(pageFunc goja.Value, args ...goja.Value) (result interf
722
722
723
723
rt := k6common .GetRuntime (f .ctx )
724
724
725
- f .waitForExecutionContext (mainExecutionContext )
725
+ f .waitForExecutionContext (mainWorld )
726
726
727
727
var err error
728
728
f .executionContextMu .RLock ()
@@ -744,7 +744,7 @@ func (f *Frame) EvaluateHandle(pageFunc goja.Value, args ...goja.Value) (handle
744
744
745
745
rt := k6common .GetRuntime (f .ctx )
746
746
747
- f .waitForExecutionContext (mainExecutionContext )
747
+ f .waitForExecutionContext (mainWorld )
748
748
749
749
var err error
750
750
f .executionContextMu .RLock ()
@@ -1377,7 +1377,7 @@ func (f *Frame) WaitForFunction(pageFunc goja.Value, opts goja.Value, args ...go
1377
1377
k6common .Throw (rt , fmt .Errorf ("failed parsing options: %w" , err ))
1378
1378
}
1379
1379
1380
- handle , err := f .waitForFunction (f .ctx , utilityExecutionContext , pageFunc , parsedOpts .Polling , parsedOpts .Interval , parsedOpts .Timeout , args ... )
1380
+ handle , err := f .waitForFunction (f .ctx , utilityWorld , pageFunc , parsedOpts .Polling , parsedOpts .Interval , parsedOpts .Timeout , args ... )
1381
1381
if err != nil {
1382
1382
k6common .Throw (rt , err )
1383
1383
}
0 commit comments