Socket
Socket
Sign inDemoInstall

math-codegen

Package Overview
Dependencies
2
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.3.0 to 0.3.1

10

lib/CodeGenerator.js

@@ -36,3 +36,9 @@ 'use strict'

this.defs.$$mathCodegen = {
throwUndefined: function (symbol) {
getProperty: function (symbol, scope, ns) {
if (scope.hasOwnProperty(symbol)) {
return scope[symbol]
}
if (ns.hasOwnProperty(symbol)) {
return ns[symbol]
}
throw SyntaxError('symbol "' + symbol + '" is undefined')

@@ -55,3 +61,3 @@ },

if (!this.statements.length) {
throw Error('there are no statements saved in this generator')
throw Error('there are no statements saved in this generator, make sure you parse an expression before compiling it')
}

@@ -58,0 +64,0 @@

2

lib/node/SymbolNode.js

@@ -5,3 +5,3 @@ 'use strict'

var id = node.name
return '(scope["' + id + '"] || ns["' + id + '"] || $$mathCodegen.throwUndefined("' + id + '"))'
return '$$mathCodegen.getProperty("' + id + '", scope, ns)'
}
{
"name": "math-codegen",
"version": "0.3.0",
"version": "0.3.1",
"description": "Generates code from mathematical expressions",

@@ -5,0 +5,0 @@ "bugs": "https://github.com/maurizzzio/math-codegen/issues",

@@ -6,3 +6,3 @@ # math-codegen

[![Coverage Status][coveralls-image]][coveralls-url]
[![Stability](https://img.shields.io/badge/stability-stable-green.svg)]()
[![Stability](https://img.shields.io/badge/stability-unstable-yellow.svg)]()

@@ -46,4 +46,2 @@ [![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)

NOTE: still a work on progress
### Lifecycle

@@ -50,0 +48,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc