David Wendt
a2ee7f9e3a
Replace `Option<Value<'gc>>` with a dedicated `ReturnValue<'gc>` type with associated methods.
...
This type explicitly signals if an immediate value is to be returned, if a value is to be returned on the stack, or if no return value is to be generated. Holders of a `ReturnValue` can also use `and_then` to schedule a `StackContinuation` to be executed when and if that value is ready.
`StackContinuations` now yield `ReturnValues` as well, so they have a moderate level of composability. For example, if you need to get a property from an object and push it on the stack, you can return the result of calling `get` directly and the machinery ensures it eventually gets there.
2019-11-20 14:30:31 -05:00
David Wendt
e36a0d8350
Allow native functions to resolve on the AVM stack for whatever reason.
2019-11-20 14:30:30 -05:00
Mike Welsh
dddfb42e1e
core: Merge ActionContext into UpdateContext
2019-10-27 13:49:47 -07:00
Nathan Adams
6a2806b44a
chore: Allow Into<Value> for test results
2019-10-21 17:22:03 +02:00
Nathan Adams
348e7f6adb
chore: Impl From<numeric> for Value, better dev ergonomics
2019-10-21 17:14:00 +02:00
Nathan Adams
83b7d679ed
chore: Impl From<GcCell<'gc, Object<'gc>>> for Value, better dev ergonomics
2019-10-21 13:00:52 +02:00
Nathan Adams
fa5616a4f9
chore: Impl From<bool> for Value, better dev ergonomics
2019-10-21 12:55:17 +02:00
Nathan Adams
0ba9cef2f0
chore: Take Into<Value> for tests
2019-10-21 12:44:21 +02:00
Nathan Adams
f24ab37810
chore: Impl From<&str> for Value, better dev ergonomics
2019-10-21 12:33:49 +02:00
Nathan Adams
796c641b3b
chore: Impl From<String> for Value, better dev ergonomics
2019-10-21 12:30:59 +02:00
Will Brindle
5b298a0814
chore: refactor test code to share common methods
2019-10-19 10:31:37 +01:00
Will Brindle
3fa198d8f2
core: Add extra test cases for Number function and resolve the issues they highlight
2019-10-19 10:29:26 +01:00
Will Brindle
463d0fc352
core: implement isNaN and Number functions. Involves updating to_number function in Value. Note: this varies a little from the ECMA spec such as not allowing spaces in numbers (i.e. ' 5' => NaN). No definitive reference for this but was found experimentally. Same with not supporting 'Infinity'
2019-10-19 10:29:26 +01:00
Will Brindle
38c66b5b8d
core: implement Boolean function
2019-10-19 10:29:26 +01:00
Nathan Adams
3d09ec81e2
Add Attribute::DontEnum
2019-10-08 16:36:39 +02:00
Nathan Adams
f2a4000ee2
Added object property attributes (initially just DontDelete)
2019-10-08 14:30:36 +02:00
Will Brindle
2e3748438a
core: define globals for NaN, Infinity, -Infinity. Should fix `typeof NaN`
2019-10-08 02:59:26 -07:00
Nathan Adams
2b54791cbb
Changed storage of object values to allow for dynamic (vs stored) properties
2019-10-02 10:49:08 -07:00
Mike Welsh
b38552204d
chore: cargo fmt
2019-09-26 11:45:45 -07:00
David Wendt
b61f264ac7
Add a check for `fscommand:` URLs
2019-09-20 15:11:33 -04:00
Mike Welsh
82c1116c42
chore: cargo fmt
2019-09-16 20:37:11 -07:00
David Wendt
f00e938299
Clean up unused functionality in preparation of a PR.
2019-09-16 20:04:30 -07:00
David Wendt
b40b10daf6
Support form submission from `getURL` function
2019-09-16 20:04:30 -07:00
David Wendt
130d9736bc
Allow builtins access to the AVM1 state directly.
2019-09-16 20:04:30 -07:00
David Wendt
359d3e4780
Propagate the RNG to the action context. This lets random work.
2019-09-16 20:04:30 -07:00
David Wendt
70d4f6c7c2
Implement more math builtins.
...
Random is currently a stub.
2019-09-16 20:04:30 -07:00
David Wendt
4e9fb2676b
Add `getURL` global builtin
2019-09-16 20:04:30 -07:00
Nathan Adams
a4cdbc4f70
Added `Math` unit tests, first avm tests :)
2019-09-02 22:19:09 +02:00
Nathan Adams
63f85446b7
Renamed builtins to globals, `_global` is a reference to the globals object
2019-09-02 20:45:19 +02:00