Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
emscripten-core
GitHub Repository: emscripten-core/emscripten
Path: blob/main/third_party/closure-compiler/node-externs/vm.js
6174 views
1
/*
2
* Copyright 2012 The Closure Compiler Authors.
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*/
16
17
/**
18
* @fileoverview Definitions for node's vm module.
19
* @see http://nodejs.org/api/vm.html
20
* @see https://github.com/joyent/node/blob/master/lib/vm.js
21
* @externs
22
* @author Daniel Wirtz <[email protected]>
23
*/
24
25
/**
26
BEGIN_NODE_INCLUDE
27
var vm = require('vm');
28
END_NODE_INCLUDE
29
*/
30
31
/**
32
* @type {Object.<string,*>}
33
*/
34
var vm = {};
35
36
/**
37
* @constructor
38
*/
39
vm.Context = function() {}; // Does not really exist
40
41
/**
42
* @param {string} code
43
* @param {string=} filename
44
*/
45
vm.runInThisContext = function(code, filename) {};
46
47
/**
48
* @param {string} code
49
* @param {Object.<string,*>=} sandbox
50
* @param {string=} filename
51
*/
52
vm.runInNewContext = function(code, sandbox, filename) {};
53
54
/**
55
* @param {string} code
56
* @param {vm.Context} context
57
* @param {string=} filename
58
*/
59
vm.runInContext = function(code, context, filename) {};
60
61
/**
62
* @param {Object.<string,*>=} initSandbox
63
* @return {vm.Context}
64
* @nosideeffects
65
*/
66
vm.createContext = function(initSandbox) {};
67
68
/**
69
* @constructor
70
*/
71
vm.Script = function() {};
72
73
/**
74
* @param {string} code
75
* @param {string=} filename
76
* @return {vm.Script}
77
* @nosideeffects
78
*/
79
vm.createScript = function(code, filename) {};
80
81
/**
82
*/
83
vm.Script.prototype.runInThisContext = function() {};
84
85
/**
86
* @param {Object.<string,*>=} sandbox
87
*/
88
vm.Script.prototype.runInNewContext = function(sandbox) {};
89
90