Rewrite evaluateScript, evaluate, jobQueue and add event loop#352
Open
Jack-Works wants to merge 1 commit into
Open
Rewrite evaluateScript, evaluate, jobQueue and add event loop#352Jack-Works wants to merge 1 commit into
Jack-Works wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Breaking changes
Behavior of
realm.evaluateScriptorrealm.evaluateIf you are using
realm.evaluateScriptorrealm.evaluate, these APIs no longer require callingresumeEvaluate().realm.evaluateScriptandrealm.evaluateno longer return a completion.If you want to preserve the old behavior, where you add an evaluator without running it, do this:
If you want to skip the debugger, do this:
Event loop & Job queue
runJobQueuehas been removed. Useagent.eventLoopandagent.jobQueueinstead. It by default isWebLikeEventLoopand will automatically flush.JobQueue API
EventLoop API
Examples: timer
Removal of
realm.activeandrealm.scope()realm.activehas been removed. It did not represent anything useful.realm.scope()has been removed. Userealm.pushTopContext()instead.evalQIn
evalQ((Q, X) => {}), theXparameter is no longer provided. UseunwrapCompletion()orX()instead.Renames
ExecutionContext.codeEvaluationStatehas been renamed toExecutionContext.CodeEvaluationStateto match ECMA-262 naming.Agent.scheduledForCleanuphas been renamed toAgent.finalizationRegistryScheduledForCleanup.The
Agent.hostDefined.cleanupFinalizationRegistryhook has moved toAgent.hostDefinedOptions.hostHooks.HostEnqueueFinalizationRegistryCleanupJob.The type of
PrivateEnvironmenthas changed fromPrivateEnvironmentRecord | NullValuetoPrivateEnvironmentRecord.Additions
runningExecutionContext()for therunning execution contextterm.surroundingAgent.runningExecutionContextis still supported.currentRealmRecord()for thecurrent realm recordterm.surroundingAgent.currentRealmRecordis still supported.activeFunctionObject()for theactive function objectterm.surroundingAgent.activeFunctionObjectis still supported.intrinsics()['%...%']for intrinsics.surroundingAgent.intrinsic('%...%')is still supported, but discouraged.ModuleCache.hasUnfinishedRequests()andModuleCache.untilAllRequestFinished()have been removed.