From ad677426cfc86bf4b13f2fbe7d2befb8d63693c8 Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Fri, 12 Aug 2016 07:23:42 -0700 Subject: [PATCH] Cleanup clear/set/throwImmediate Reviewed By: vjeux Differential Revision: D3703300 fbshipit-source-id: ad03d558d6af61aba17899ec256d71fdda4c4c84 --- Libraries/Interaction/InteractionManager.js | 3 +- Libraries/vendor/core/clearImmediate.js | 12 ------- Libraries/vendor/core/setImmediate.js | 12 ------- Libraries/vendor/core/throwImmediate.js | 38 --------------------- 4 files changed, 2 insertions(+), 63 deletions(-) delete mode 100644 Libraries/vendor/core/clearImmediate.js delete mode 100644 Libraries/vendor/core/setImmediate.js delete mode 100644 Libraries/vendor/core/throwImmediate.js diff --git a/Libraries/Interaction/InteractionManager.js b/Libraries/Interaction/InteractionManager.js index 845df4d89..c4216344c 100644 --- a/Libraries/Interaction/InteractionManager.js +++ b/Libraries/Interaction/InteractionManager.js @@ -19,7 +19,6 @@ const TaskQueue = require('TaskQueue'); const infoLog = require('infoLog'); const invariant = require('fbjs/lib/invariant'); const keyMirror = require('fbjs/lib/keyMirror'); -const setImmediate = require('setImmediate'); type Handle = number; import type {Task} from 'TaskQueue'; @@ -152,6 +151,8 @@ let _nextUpdateHandle = 0; let _inc = 0; let _deadline = -1; +declare function setImmediate(callback: any, ...args: Array): number; + /** * Schedule an asynchronous update to the interaction state. */ diff --git a/Libraries/vendor/core/clearImmediate.js b/Libraries/vendor/core/clearImmediate.js deleted file mode 100644 index 75540149f..000000000 --- a/Libraries/vendor/core/clearImmediate.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * Copyright (c) 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule clearImmediate - */ - -module.exports = global.clearImmediate; diff --git a/Libraries/vendor/core/setImmediate.js b/Libraries/vendor/core/setImmediate.js deleted file mode 100644 index 265f98a45..000000000 --- a/Libraries/vendor/core/setImmediate.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * Copyright (c) 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule setImmediate - */ - -module.exports = global.setImmediate; diff --git a/Libraries/vendor/core/throwImmediate.js b/Libraries/vendor/core/throwImmediate.js deleted file mode 100644 index 0d12c3097..000000000 --- a/Libraries/vendor/core/throwImmediate.js +++ /dev/null @@ -1,38 +0,0 @@ -/** - * @generated SignedSource<<5c985f16e4f2e576657ab2b1551adf97>> - * - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !! This file is a check-in of a static_upstream project! !! - * !! !! - * !! You should not modify this file directly. Instead: !! - * !! 1) Use `fjs use-upstream` to temporarily replace this with !! - * !! the latest version from upstream. !! - * !! 2) Make your changes, test them, etc. !! - * !! 3) Use `fjs push-upstream` to copy your changes back to !! - * !! static_upstream. !! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * - * Copyright 2004-present Facebook. All Rights Reserved. - * - * @providesModule throwImmediate - * @typechecks - */ - -'use strict'; - -var setImmediate = require('setImmediate'); - -function throwArg(error) { - throw error; -} - -/** - * Throws the supplied error in a new execution loop. - * - * @param {*} error - */ -function throwImmediate(error) { - setImmediate(throwArg, error); -} - -module.exports = throwImmediate;