Return v8::Value from JsRuntime::execute_script

feat(core): return v8::Value from JsRuntime::execute_script (#11129)
Return v8::Value from JsRuntime::execute_scriptfeatreturn value jsruntime execute script core

Committed by bartlomieju

commit message
feat(core): return v8::Value from JsRuntime::execute_script (#11129)

This commit changes return type of JsRuntime::execute_script to include
v8::Value returned from evaluation.
 
When embedding deno_core it is sometimes useful to be able to inspect
script evaluation value without the hoops of adding ops to store the
value on the OpState.
 
v8::Global<v8::Value> is used so consumers don't have to pass
scope themselves.

Editor assessment

The subject states the API change exactly: JsRuntime::execute_script returns a v8::Value. The body teaches the motivation with concrete embedding pain (inspecting evaluation results previously required store-ops on the OpState) and justifies the design choice (a v8::Global so consumers need not manage a scope). That is motivation, mechanism, and rationale in four lines. Type feat and scope core are accurate, mood and length are clean, and no footers are needed. An exemplary, instructive message.

Browse categories

More feat examples · Back to search