| Verifies JavaScript pretty-printing functionality. |
| |
| |
| Running: semicolonAfterFunctionExpression |
| ====== 8< ------ |
| var onClick = function() { |
| console.log('click!'); |
| }; |
| console.log('done'); |
| |
| ------ >8 ====== |
| Correct mapping for <onClick> |
| Correct mapping for <function> |
| Correct mapping for <console> |
| Correct mapping for <log> |
| Correct mapping for <click!> |
| Correct mapping for <done> |
| |
| Running: semicolonAfterMultipleFunctionExpressions |
| ====== 8< ------ |
| var onStart = function() { |
| a(); |
| } |
| , onFinish = function() { |
| b(); |
| }; |
| |
| ------ >8 ====== |
| Correct mapping for <onStart> |
| Correct mapping for <onFinish> |
| Correct mapping for <a()> |
| Correct mapping for <b()> |
| |
| Running: semicolonAfterEmptyFunctionExpressions |
| ====== 8< ------ |
| var onStart = function() {} |
| , delay = 1000 |
| , belay = document.activeElement; |
| |
| ------ >8 ====== |
| Correct mapping for <onStart> |
| Correct mapping for <delay> |
| Correct mapping for <1000> |
| Correct mapping for <belay> |
| Correct mapping for <activeElement> |
| |
| Running: continueStatementFormatting |
| ====== 8< ------ |
| function foo() { |
| while (1) { |
| if (a) |
| continue; |
| test(); |
| } |
| } |
| |
| ------ >8 ====== |
| Correct mapping for <function> |
| Correct mapping for <1> |
| Correct mapping for <continue> |
| Correct mapping for <test> |
| |
| Running: inconsistentSpaceAfterNull |
| ====== 8< ------ |
| 1 || null; |
| |
| ------ >8 ====== |
| Correct mapping for <||> |
| Correct mapping for <null> |
| Correct mapping for <;> |
| |
| Running: squashMultipleNewlines |
| ====== 8< ------ |
| a(); |
| |
| b(); |
| |
| ------ >8 ====== |
| Correct mapping for <a> |
| Correct mapping for <b> |
| |
| Running: ensureExponentialOperator |
| ====== 8< ------ |
| 2 ** 3 |
| |
| ------ >8 ====== |
| Correct mapping for <2> |
| Correct mapping for <**> |
| Correct mapping for <3> |
| |