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