From 6240501fb4f438a3e4ae8e15464d9d4162e10a21 Mon Sep 17 00:00:00 2001 From: Matthijs van der Burgh Date: Wed, 9 Feb 2022 15:18:03 +0100 Subject: [PATCH] Fix transpiler (#501) * (transpiler) always enable errors * (transpiler) throw error on LogError * (transpiler) fix properties regex --- es6-transpiler.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/es6-transpiler.js b/es6-transpiler.js index 3332443fd..ff3f5df37 100644 --- a/es6-transpiler.js +++ b/es6-transpiler.js @@ -1,6 +1,8 @@ const debug = require('debug') const path = require('path') +debug.enable('ES6Transpiler:Error') + const colors = { GRAY: 0, RED: 1, @@ -18,7 +20,10 @@ const stringifyObjects = (...args) => args : arg) const logError = debug('ES6Transpiler:Error') -logError.log = (...args) => console.error(...stringifyObjects(...args)) +logError.log = (...args) => { + console.error(...stringifyObjects(...args)) + throw new Error("Execution stopped because of an error, sea above.") +} logError.color = colors.RED const logWarning = debug('ES6Transpiler:Warning') @@ -217,7 +222,7 @@ const transpile = { exportedProperties: (filepath) => [ // from: // ROS3D.MARKER_ARROW = 0; - /\nROS3D\.(.*)\s*=\s*(.*)/g, + /\nROS3D\.(\S*)\s*=\s*(.*)/g, // to: // export var MARKER_ARROW = 0; (match, $1, $2) => {