From d284d75f3960247c324b2c9916256a2474eab432 Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Tue, 27 Mar 2018 11:15:50 -0400 Subject: [PATCH] js compiler: Prevent octals in generated code * src/current/compiler/js.xsl (compiler:js-number): New function to remove leading zeroes. (compile)[lv:const]: Use it. * src/current/compiler/js-calc.xsl (compile-calc)[c:const]: Use it. --- src/current/compiler/js-calc.xsl | 3 ++- src/current/compiler/js.xsl | 27 ++++++++++++++++++++++++--- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/src/current/compiler/js-calc.xsl b/src/current/compiler/js-calc.xsl index 072f9037..2fff67d5 100644 --- a/src/current/compiler/js-calc.xsl +++ b/src/current/compiler/js-calc.xsl @@ -40,6 +40,7 @@ xmlns:c="http://www.lovullo.com/calc" xmlns:lv="http://www.lovullo.com/rater" xmlns:preproc="http://www.lovullo.com/rater/preproc" + xmlns:compiler="http://www.lovullo.com/rater/compiler" xmlns:calc-compiler="http://www.lovullo.com/calc/compiler"> @@ -453,7 +454,7 @@ --> diff --git a/src/current/compiler/js.xsl b/src/current/compiler/js.xsl index 8bf90930..78afb0c4 100644 --- a/src/current/compiler/js.xsl +++ b/src/current/compiler/js.xsl @@ -444,7 +444,7 @@ , - + ] @@ -455,7 +455,7 @@ , - + ]; @@ -470,7 +470,7 @@ consts[' '] = - + ; @@ -529,6 +529,27 @@ + + + + + + + + + + + + +