Skip to content

Commit

Permalink
adding deno namespace to repl
Browse files Browse the repository at this point in the history
  • Loading branch information
Shiva Prasanth committed Oct 15, 2018
1 parent 375048c commit d890eff
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions js/repl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import { flatbuffers } from "flatbuffers";
import { assert } from "./util";
import * as dispatch from "./dispatch";
import { window } from "./globals";
import * as deno from './deno';

// FIXME assignis like this is bad
window.deno = deno

This comment has been minimized.

Copy link
@hayd

hayd Oct 15, 2018

Contributor

Does this affect all window objects? It might be better to do this inside the repl_loop body.

This comment has been minimized.

Copy link
@kitsonk

kitsonk Oct 15, 2018

Contributor

I would recommend a special scope for the repl. Maybe something like:

const replScope = Object.defineProperty("deno", Object.create(window), { value: deno, enumerable: true });

This comment has been minimized.

Copy link
@hayd

hayd Oct 16, 2018

Contributor

I don't think this quite works (I couldn't get it working), I tried a bunch of variations!

This comment has been minimized.

Copy link
@kitsonk

kitsonk Oct 16, 2018

Contributor

Yeah, sorry... the return of Object.defineProperty is wrong... I put comments in the other PR.

/** Read the next line for the repl.
*
* import { readFile } from "deno";
Expand Down

0 comments on commit d890eff

Please sign in to comment.