From 5d83150951bbb94a8ea9a1bb6cbf24c5fd5e66f1 Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Fri, 2 Nov 2012 16:35:09 +0100 Subject: [PATCH] Attach .raw property to literal nodes --- acorn.js | 1 + index.html | 1 + 2 files changed, 2 insertions(+) diff --git a/acorn.js b/acorn.js index 83dc01f140..eb1c7d4ab4 100644 --- a/acorn.js +++ b/acorn.js @@ -1421,6 +1421,7 @@ case _num: case _string: case _regexp: var node = startNode(); node.value = tokVal; + node.raw = input.slice(tokStart, tokEnd); next(); return finishNode(node, "Literal"); diff --git a/index.html b/index.html index 2cee49e88c..5d63154009 100644 --- a/index.html +++ b/index.html @@ -1033,6 +1033,7 @@ or {}.

case _num: case _string: case _regexp: var node = startNode(); node.value = tokVal; + node.raw = input.slice(tokStart, tokEnd); next(); return finishNode(node, "Literal");