forked from google/blockly-games
-
Notifications
You must be signed in to change notification settings - Fork 0
/
interpreter-externs.js
91 lines (76 loc) · 1.94 KB
/
interpreter-externs.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
/**
* @fileoverview Externs for JS-Interpreter.
* @externs
*/
/**
* @param {string} code
* @param {Function} opt_initFunc
* @constructor
*/
function Interpreter(code, opt_initFunc) {};
/**
* @type {!Object}
*/
Interpreter.prototype.OBJECT;
/**
* @type {!Object}
*/
Interpreter.prototype.ARRAY;
/**
* @type {!Object}
*/
Interpreter.prototype.FUNCTION;
/**
* @type {!Object}
*/
Interpreter.prototype.STRING;
/**
* @type {!Object}
*/
Interpreter.prototype.BOOLEAN;
/**
* @type {!Object}
*/
Interpreter.prototype.UNDEFINED;
/**
* Execute one step of the interpreter.
* @return {boolean} True if a step was executed, false if no more instructions.
*/
Interpreter.prototype.step = function() {};
/**
* Execute the interpreter to program completion.
*/
Interpreter.prototype.run = function() {};
/**
* Create a new data object for a primitive.
* @param {undefined|null|boolean|number|string} data Data to encapsulate.
* @return {!Object} New data object.
*/
Interpreter.prototype.createPrimitive = function(data) {};
/**
* Create a new data object.
* @param {Object} parent Parent constructor function.
* @return {!Object} New data object.
*/
Interpreter.prototype.createObject = function(parent) {};
/**
* Create a new native function.
* @param {!Function} nativeFunc JavaScript function.
* @return {!Object} New function.
*/
Interpreter.prototype.createNativeFunction = function(nativeFunc) {};
/**
* Fetch a property value from a data object.
* @param {!Object} obj Data object.
* @param {*} name Name of property.
* @return {Object} Property value (may be undefined).
*/
Interpreter.prototype.getProperty = function(obj, name) {};
/**
* Set a property value on a data object.
* @param {!Object} obj Data object.
* @param {*} name Name of property.
* @param {*} value New property value.
* @param {boolean} opt_fixed Unchangable property if true.
*/
Interpreter.prototype.setProperty = function(obj, name, value, opt_fixed) {};