File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change 1
- #Trash Script
1
+ # Trash Script
2
2
3
3
A very tiny JS-like script interpreter implemented throw JS.
4
4
@@ -11,19 +11,20 @@ TrashScript was originally designed for modules in the
11
11
12
12
While not all JavaScript syntax has been implemented, the majority of commonly used syntax is available.
13
13
14
- ###Keywords: How to allow eval in chrome extension
14
+ ### Keywords:
15
+ How to allow eval in chrome extension
15
16
16
17
17
- ##Usage examples:
18
+ ## Usage examples:
18
19
19
- ###Config
20
+ ### Config
20
21
```
21
22
TrashScript.config = {
22
23
max_exec_limit:1000000 //default
23
24
}
24
25
```
25
26
26
- ###Basic
27
+ ### Basic
27
28
```
28
29
var executor = TrashScript("Source code",function(e)
29
30
{
@@ -36,7 +37,7 @@ var executor = TrashScript("Source code",function(e)
36
37
executor.exec();
37
38
```
38
39
39
- ###Bind existing JavaScript functions or objects
40
+ ### Bind existing JavaScript functions or objects
40
41
```
41
42
TrashScript.bind("alert",function(arg){
42
43
window.alert(arg);
@@ -52,7 +53,7 @@ TrashScript.bind({
52
53
});
53
54
```
54
55
55
- ###Context object for 'this'
56
+ ### Context object for 'this'
56
57
```
57
58
var executor = TrashScript("function aaa(){alert(this)};return aaa()",function(e){...});
58
59
executor.exec(window); //'this' is window
You can’t perform that action at this time.
0 commit comments