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

26 Commits

Author SHA1 Message Date
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
98be5e74da go vet
This fixes #76

I cheated on some of these.
2014-05-28 21:46:08 -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
7163cd7841 Skip unexported fields, begin json.Marshaler support
* The "reflect" package is willing to expose unexported fields in structs (a little suprising).
* Skip unexported fields when enumerating or trying to access (pretend they don't exist).
* Allow structs that implement json.Marshaler to work as expected in a JSON.stringify call.

If we let the runtime try to access unexported fields, it'll cause a panic.

This fixes #64
2014-04-12 11:53:04 -07:00
Robert Krimen
5aa653244a Fix Put to see set/get properties 2014-02-15 10:20:33 -08:00
Robert Krimen
333bb23c07 Guard against _nilGetSetObject sneaking in 2014-02-14 23:23:39 -08:00
Robert Krimen
99263cd960 Clarify AccessorDescriptor logic in DefineOwnProperty even more 2014-02-14 22:33:27 -08:00
Robert Krimen
acf0a991f7 Can set a setter/getter if absent (8.12.9 / 10.a.ii.1) 2014-02-14 22:23:15 -08:00
Robert Krimen
9c45463cd6 Preserve existing get/set unless explicitly undefined 2014-02-14 19:46:37 -08:00
Robert Krimen
ee1cce94ef If set === undefined => writable = false 2014-02-13 21:38:20 -08:00
Robert Krimen
57e0a468ac Fix a few aspects of accessor properties 2014-02-13 21:30:26 -08:00
Tim Jurcka
dd88ce83b8 Call getter/setter if property is AccessorDescriptor
This fixes #36
This fixes #56
2014-02-12 21:52:42 -08:00
Robert Krimen
c47cf7be6e Improve arguments property handling
Also, fix an issue with double enumeration of arguments
2014-01-19 21:08:05 -08:00
Robert Krimen
5282a5a45b 8.12.9: Keep [[Value]] if not explicitly given 2013-07-21 17:48:42 -07:00
Robert Krimen
9b5a81157b 8.12.9: Fix panic when [[Writable]] is something but [[Value]] is not 2013-07-21 17:48:36 -07:00
Robert Krimen
6307c5ebaf 8.12.9: Merge property descriptors (writable, enumerable, configurable) 2013-07-21 17:48:32 -07:00
Robert Krimen
4c63bd4498 8.12.9: Reject instead of just returning false 2013-07-21 17:48:06 -07:00
Robert Krimen
ea621687a4 Add Otto.Copy() 2013-07-14 14:20:01 -07:00
Robert Krimen
73bf2f9fa8 Implement return/break/continue without panic/recover
This fixes #25
2013-06-13 22:17:04 -07:00
Robert Krimen
8b16ca18d8 Add enumeration for Arguments (argumentsEnumerate) 2013-06-02 16:21:49 -07:00
Robert Krimen
7ff3e8668e Allow (internal) enumeration through _every_ Object property
For .freeze, .isFrozen, etc.
2013-06-02 15:21:25 -07:00
Robert Krimen
599d565e55 Use defineOwnProperty (not put) for Array (literal) initialization 2013-06-01 23:11:13 -07:00
Robert Krimen
6669f98a8e Improve type_go_* behavior 2013-05-31 22:50:51 -07:00
Robert Krimen
bdd28e5938 Revamp property mode bit fiddling (write, enumerate, configure) 2013-05-18 15:56:35 -07:00
Robert Krimen
7e2b4f2063 Rewrite of property handling to be more robust and compliant
* No more _stash
* Now using a "virtual table" system via _objectClass
* Make Array.concat GoArray compatible (via .isArray())

Fix #16
2013-05-12 14:14:51 -07:00