From e7a34897a122342485468999a507626f1ea91507 Mon Sep 17 00:00:00 2001 From: binsee <5285894+binsee@users.noreply.github.com> Date: Wed, 25 Jan 2023 03:07:55 +0800 Subject: [PATCH] fix: error should be thrown (#1817) --- src/root.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/root.js b/src/root.js index df6f11fa6..6067ca69c 100644 --- a/src/root.js +++ b/src/root.js @@ -98,10 +98,10 @@ Root.prototype.load = function load(filename, options, callback) { /* istanbul ignore if */ if (!callback) return; - var cb = callback; - callback = null; if (sync) throw err; + var cb = callback; + callback = null; cb(err, root); }