mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-02 02:08:24 +08:00
Breaking changes here https://github.com/mochajs/mocha/releases/tag/v8.0.0 seem fine. DISABLE_THIRD_PARTY_CHECK=Update Mocha Bug: chromium:1101784 Change-Id: Idc75c94f9a923e2b0ca13d1d1331540cb1c5d3a3 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2279830 Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org> Commit-Queue: Peter Marshall <petermarshall@chromium.org>
24 lines
601 B
JavaScript
24 lines
601 B
JavaScript
// a simple worker which can be used both in node.js and in the browser
|
|
// only the load process differs for node.js and web workers
|
|
|
|
// load workerpool
|
|
if (typeof importScripts === 'function') {
|
|
// web worker
|
|
importScripts('../../dist/workerpool.js');
|
|
}
|
|
else {
|
|
// node.js
|
|
var workerpool = require('../../dist/workerpool.js');
|
|
}
|
|
|
|
// a deliberately inefficient implementation of the fibonacci sequence
|
|
function fibonacci(n) {
|
|
if (n < 2) return n;
|
|
return fibonacci(n - 2) + fibonacci(n - 1);
|
|
}
|
|
|
|
// create a worker and register public functions
|
|
workerpool.worker({
|
|
fibonacci: fibonacci
|
|
});
|