| Tests the extraction of javascript identifier names from function text. |
| |
| |
| Running: testFunctionArguments |
| Text: |
| function foo(a, b) { } |
| |
| Identifiers: |
| id: a offset: 13 |
| id: b offset: 16 |
| |
| Running: testSimpleVariable |
| Text: |
| function foo() { var a = 1; } |
| |
| Identifiers: |
| id: a offset: 21 |
| |
| Running: testMemberExpression |
| Text: |
| function foo() { var a = b.c.d.e; } |
| |
| Identifiers: |
| id: a offset: 21 |
| id: b offset: 25 |
| |
| Running: testFunctionCall |
| Text: |
| function foo() { var a = doSomething(b, true, 10); } |
| |
| Identifiers: |
| id: a offset: 21 |
| id: doSomething offset: 25 |
| id: b offset: 37 |
| |
| Running: testPropertyLiteral |
| Text: |
| function foo() { var a = b['test'];} |
| |
| Identifiers: |
| id: a offset: 21 |
| id: b offset: 25 |
| |
| Running: testComputedProperty |
| Text: |
| function foo() { var a = b[variableName];} |
| |
| Identifiers: |
| id: a offset: 21 |
| id: b offset: 25 |
| id: variableName offset: 27 |
| |
| Running: testNestedFunction1 |
| Text: |
| function foo() { var a = 1; function bar() { var b = 1; } var c = 3;} |
| |
| Identifiers: |
| id: a offset: 21 |
| id: bar offset: 37 |
| id: c offset: 62 |
| |
| Running: testNestedFunction2 |
| Text: |
| function foo() { var a = 1; var bar = function (){ var b = 1; }; var c = 3;} |
| |
| Identifiers: |
| id: a offset: 21 |
| id: bar offset: 32 |
| id: c offset: 69 |
| |
| Running: testNestedFunction3 |
| Text: |
| function foo() { var a = x => x * 2 } |
| |
| Identifiers: |
| id: a offset: 21 |
| |