Encode op errors as strings instead of numbers (#6977)

This commit is contained in:
Bartek Iwańczuk 2020-08-07 22:47:18 +02:00 committed by GitHub
parent 479164d287
commit 59ca66a207
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 197 additions and 293 deletions

View file

@ -3,7 +3,6 @@
((window) => {
const core = window.Deno.core;
const util = window.__bootstrap.util;
const getErrorClass = window.__bootstrap.errors.getErrorClass;
// Using an object without a prototype because `Map` was causing GC problems.
const promiseTable = Object.create(null);
let _nextPromiseId = 1;
@ -22,7 +21,7 @@
function unwrapResponse(res) {
if (res.err != null) {
throw new (getErrorClass(res.err.kind))(res.err.message);
throw new (core.getErrorClass(res.err.kind))(res.err.message);
}
util.assert(res.ok != null);
return res.ok;