|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
275 bytes
|
| Line | |
|---|
| 1 | var evaluate = require('../');
|
|---|
| 2 | var parse = require('esprima').parse;
|
|---|
| 3 |
|
|---|
| 4 | var src = '[1,2,3+4*10+n,foo(3+5),obj[""+"x"].y]';
|
|---|
| 5 | var ast = parse(src).body[0].expression;
|
|---|
| 6 |
|
|---|
| 7 | console.log(evaluate(ast, {
|
|---|
| 8 | n: 6,
|
|---|
| 9 | foo: function (x) { return x * 100 },
|
|---|
| 10 | obj: { x: { y: 555 } }
|
|---|
| 11 | }));
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.