From 4af524112e843c33233493e4e509b4f755eb4cab Mon Sep 17 00:00:00 2001 From: Jeff Avallone Date: Wed, 17 Dec 2014 12:07:25 -0500 Subject: [PATCH] Moving properties out of the way --- src/js/parser/javascript/node.js | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/src/js/parser/javascript/node.js b/src/js/parser/javascript/node.js index 11bf36d..d24c3d2 100644 --- a/src/js/parser/javascript/node.js +++ b/src/js/parser/javascript/node.js @@ -6,11 +6,25 @@ var renderCounter = 0, export default class Node { constructor(textValue, offset, elements, properties) { - _.extend(this, { - textValue, - offset, - elements: elements || [] - }, properties); + this.textValue = textValue; + this.offset = offset; + this.elements = elements || []; + + this.properties = properties; + + // TEMPORARY + _.forOwn(this.properties, (_, key) => { + Object.defineProperty(this, key, { + get: function() { + return this.properties[key]; + }, + + set: function(value) { + this.properties[key] = value; + } + }); + }); + // /TEMPORARY } set module(mod) {