Skip to content

Commit

Permalink
Avoid apply and move arrayToStr to util
Browse files Browse the repository at this point in the history
  • Loading branch information
ulivz authored and ry committed Jun 4, 2018
1 parent a315d1e commit 0639f9b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 4 additions & 0 deletions util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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:
//
Expand Down
6 changes: 1 addition & 5 deletions v8_source_maps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, SourceMapConsumer>();

Expand Down Expand Up @@ -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);
}

0 comments on commit 0639f9b

Please sign in to comment.