| 2199 | CHECK_CALL_CONTEXT(callContext); |
| 2200 | bindRuntimeFunction(callContext.getContext(), |
| 2201 | callContext.getExceptionTracker(), |
| 2202 | workerJSValue, |
| 2203 | "postMessage", |
| 2204 | &JavaScriptRuntime::workerPostMessage); |
| 2205 | CHECK_CALL_CONTEXT(callContext); |
| 2206 | bindRuntimeFunction(callContext.getContext(), |
| 2207 | callContext.getExceptionTracker(), |
| 2208 | workerJSValue, |
| 2209 | "terminate", |
| 2210 | &JavaScriptRuntime::workerTerminate); |
| 2211 | CHECK_CALL_CONTEXT(callContext); |
| 2212 | { |
| 2213 | std::lock_guard<Mutex> guard(_jsWorkersMutex); |
| 2214 | _jsWorkers.emplace_back(weakRef(workerRuntime.get())); |
| 2215 | } |
| 2216 | return workerJSValue; |
| 2217 | } |
| 2218 | |
| 2219 | JSValueRef JavaScriptRuntime::queueMicrotask(JSFunctionNativeCallContext& callContext) { |
| 2220 | callContext.getContext().enqueueMicrotask(callContext.getParameter(0), callContext.getExceptionTracker()); |
| 2221 | return callContext.getContext().newUndefined(); |
| 2222 | } |