Comparing version 1.1.0 to 1.2.0
@@ -156,3 +156,3 @@ 'use strict'; | ||
if (node.scope) { | ||
return 'context.get(\"' + node.scope + '\", \"' + node.name + '\")'; | ||
return 'context.get(\"' + node.name + '\", \"' + node.scope + '\")'; | ||
} | ||
@@ -205,5 +205,5 @@ return 'context.get(\"' + node.name + '\")'; | ||
if (locals.get !== 'function') { | ||
locals.get = function (scope, name) { | ||
if (!name) return locals[scope]; | ||
return locals[scope] ? locals[scope][name] : undefined; | ||
locals.get = function (name, scope) { | ||
if (typeof scope !== 'undefined') return locals[scope] ? locals[scope][name] : undefined; | ||
return locals[name]; | ||
}; | ||
@@ -210,0 +210,0 @@ } |
{ | ||
"name": "formula", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "Formula runtime for JavaScript.", | ||
@@ -5,0 +5,0 @@ "main": "lib/compiler.js", |
@@ -134,4 +134,4 @@ // Copyright 2015 Peter W Moresi | ||
if (precedents && !suppress) { precedents.push(node); } | ||
if (node.scope) { | ||
return 'context.get(\"' + node.scope + '\", \"' + node.name + '\")'; | ||
if ( node.scope) { | ||
return 'context.get(\"' + node.name + '\", \"' + node.scope + '\")'; | ||
} | ||
@@ -188,5 +188,5 @@ return 'context.get(\"' + node.name + '\")'; | ||
if (locals.get !== 'function') { | ||
locals.get = (scope, name) => { | ||
if (!name) return locals[scope] | ||
return locals[scope] ? locals[scope][name] : undefined | ||
locals.get = (name, scope) => { | ||
if (typeof scope !== 'undefined') return locals[scope] ? locals[scope][name] : undefined | ||
return locals[name] | ||
} | ||
@@ -193,0 +193,0 @@ } |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
500523