From 0639f9b7cc845579c59f5a792dcacb76bb28a749 Mon Sep 17 00:00:00 2001 From: ULIVZ <472590061@qq.com> Date: Fri, 1 Jun 2018 16:52:30 +0800 Subject: [PATCH] Avoid apply and move arrayToStr to util --- util.ts | 4 ++++ v8_source_maps.ts | 6 +----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/util.ts b/util.ts index f6beba2380..7ac7b155ca 100644 --- a/util.ts +++ b/util.ts @@ -23,6 +23,10 @@ export function typedArrayToArrayBuffer(ta: TypedArray): ArrayBuffer { return ab as ArrayBuffer; } +export function arrayToStr(ui8: Uint8Array): string { + return String.fromCharCode(...ui8); +} + // A `Resolvable` is a Promise with the `reject` and `resolve` functions // placed as methods on the promise object itself. It allows you to do: // diff --git a/v8_source_maps.ts b/v8_source_maps.ts index 1709789847..7209e192c4 100644 --- a/v8_source_maps.ts +++ b/v8_source_maps.ts @@ -4,6 +4,7 @@ // Originated from source-map-support but has been heavily modified for deno. import { SourceMapConsumer, MappedPosition } from "source-map"; import * as base64 from "base64-js"; +import { arrayToStr } from "./util"; const consumers = new Map(); @@ -270,8 +271,3 @@ function mapEvalOrigin(origin: string): string { // Make sure we still return useful information if we didn't find anything return origin; } - -// TODO move to util? -function arrayToStr(ui8: Uint8Array): string { - return String.fromCharCode.apply(null, ui8); -}