From 2d19fc6cbc2adcbf848896158a0363bbc68c137b Mon Sep 17 00:00:00 2001 From: Ryan Duffy Date: Tue, 6 Jun 2017 09:39:22 -0500 Subject: [PATCH] move getClosestExpression into worker --- src/utils/parser/index.js | 2 +- src/utils/parser/worker.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils/parser/index.js b/src/utils/parser/index.js index 6b7ee98bbf..d835cfbe6a 100644 --- a/src/utils/parser/index.js +++ b/src/utils/parser/index.js @@ -1,11 +1,11 @@ // @flow import { workerUtils } from "devtools-utils"; -import { getClosestExpression } from "./utils/closest"; const { WorkerDispatcher } = workerUtils; const dispatcher = new WorkerDispatcher(); +const getClosestExpression = dispatcher.task("getClosestExpression"); const getSymbols = dispatcher.task("getSymbols"); const getVariablesInScope = dispatcher.task("getVariablesInScope"); const getOutOfScopeLocations = dispatcher.task("getOutOfScopeLocations"); diff --git a/src/utils/parser/worker.js b/src/utils/parser/worker.js index 9bb4997852..374ba3c196 100644 --- a/src/utils/parser/worker.js +++ b/src/utils/parser/worker.js @@ -1,3 +1,4 @@ +import { getClosestExpression } from "./utils/closest"; import { getVariablesInScope } from "./scopes"; import getSymbols from "./getSymbols"; import getOutOfScopeLocations from "./getOutOfScopeLocations"; @@ -6,6 +7,7 @@ import { workerUtils } from "devtools-utils"; const { workerHandler } = workerUtils; self.onmessage = workerHandler({ + getClosestExpression, getOutOfScopeLocations, getSymbols, getVariablesInScope