1
0
mirror of https://github.com/robertkrimen/otto synced 2025-10-12 20:27:30 +08:00
Commit Graph

11 Commits

Author SHA1 Message Date
Steven Hartland
026a1d9a9c
chore: lint and naming refactor (#475)
Enable more linters, address the issues and do a major naming refactor
to use golang lower camelCase identifiers for types, functions, methods
and variable names.

Also: 
* Clean up inline generation so it doesn't rely on temporary variables.
* Remove unused functions generated by inline.pl.
2022-12-04 21:49:38 +00:00
Steven Hartland
a3b51c68f2
chore: enable whitespace linter and fix errors (#456)
Enable the whitespace linter and fix the errors resulting from it.

Also:
* Remove unneeded golangci-lint config for disabled linters.
* Correct test number for panic in previous commit.
2022-11-26 13:33:09 +00:00
Dmitry Panov
432b4361a7 Fixed TypeError message when evaluating a.b["c"] where a.b is undefined. 2015-10-15 21:07:43 +01:00
Dmitry Panov
9d3cca217b Fixed error position for "Cannot access member '%s' of %s" 2015-04-04 14:27:24 +01:00
Robert Krimen
ed456945de Improve error reporting (again) 2014-06-21 21:16:58 -07:00
Robert Krimen
e6768252c2 Improve error reporting
* Delay entering global scope on code evaluation, not runtime creation

This fixes #66
2014-06-12 21:27:32 -07:00
Robert Krimen
709a0aa7ff Value.string(), .float64(), .bool(), etc. 2014-06-06 21:29:40 -07:00
Robert Krimen
918abeb8d8 The zero value of Value is now defined to be undefined
Previously, it was a publically accessible but invalid value (valueEmpty).

* Deprecate internal use of UndefinedValue(), NullValue(), FalseValue(), TrueValue()
* Guard against Empty, Result, Reference values from escaping the package
2014-05-28 21:23:32 -07:00
Robert Krimen
9cd045ef04 Simplification & refactor of (parts of) the runtime
* Proper lowercasing for internal stuff
* *Environment => *_stash
* ExecutionContext => _scope
* Simpler & shallower call/construct mechanics
* Remove unnecessary fields & methods
* Better scoping (no more stack): []*_scope => _scope.outer
* Some speed improvements

In preparation for #66
2014-05-27 22:05:35 -07:00
Robert Krimen
a15d66ea64 Fix missing interrupt 2014-04-25 23:04:44 -07:00
Robert Krimen
bf7b16f4a3 Add internal compilation step
* Streamline what we get from "otto/parser"
* Get rid of some "otto/parser" cruft
* FunctionExpression => FunctionLiteral
* The debugger statement (debugger) should do nothing (not panic)
* Fix aspects of function expression call evaluation
2014-04-19 14:05:51 -07:00