first commit
This commit is contained in:
35
build/node_modules/prepack/lib/utils/errors.js
generated
vendored
Normal file
35
build/node_modules/prepack/lib/utils/errors.js
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.ignoreErrorsIn = ignoreErrorsIn;
|
||||
|
||||
var _errors = require("../errors.js");
|
||||
|
||||
var _realm = require("../realm.js");
|
||||
|
||||
/**
|
||||
* Copyright (c) 2017-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.
|
||||
*/
|
||||
|
||||
function ignoreErrorsIn(realm, f) {
|
||||
var savedHandler = realm.errorHandler;
|
||||
realm.errorHandler = function (d) {
|
||||
return "Recover";
|
||||
};
|
||||
try {
|
||||
return f();
|
||||
} catch (err) {
|
||||
if (err instanceof _errors.FatalError) return undefined;
|
||||
throw err;
|
||||
} finally {
|
||||
realm.errorHandler = savedHandler;
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=errors.js.map
|
||||
Reference in New Issue
Block a user