[node]: add props to repl.Context

This commit is contained in:
islishude
2018-11-17 12:41:11 +08:00
parent d202969f89
commit cd38ae33de
3 changed files with 12 additions and 2 deletions

View File

@@ -2501,7 +2501,9 @@ declare module "readline" {
}
declare module "vm" {
interface Context { }
interface Context {
[key: string]: any;
}
interface BaseOptions {
/**
* Specifies the filename used in stack traces produced by this script.

View File

@@ -3675,6 +3675,12 @@ import * as p from "process";
function test() {
throw new repl.Recoverable(new Error("test"));
}
_server.context.key0 = 1;
_server.context.key1 = "string";
_server.context.key2 = true;
_server.context.key3 = [];
_server.context.key4 = {};
}
}

View File

@@ -2390,7 +2390,9 @@ declare module "readline" {
}
declare module "vm" {
export interface Context { }
export interface Context {
[key: string]: any;
}
export interface ScriptOptions {
filename?: string;
lineOffset?: number;