Commit Graph

85 Commits

Author SHA1 Message Date
5ce57a6434 Fix default fromIndex in String#lastIndexOf (#165) 2018-07-13 13:30:48 +02:00
365884ff73 Add String#lastIndexOf and improve tests (#163) 2018-07-10 03:31:51 +02:00
51ede113dd Fix possible out of bounds read in string UTF8 conversion 2018-05-23 15:37:09 +02:00
33b10e347b Properly resolve top level enums to i32s, see #116 2018-05-22 12:06:03 +02:00
ea0eb7f1a5 Add a simple UTF8 converter, i.e. for calling C++ APIs; Fix disabling 'abort' entirely 2018-05-21 23:14:47 +02:00
6d0b5d92c2 Minor string comparision optimizations (#77) 2018-04-16 23:02:55 +02:00
b7ef21950b Add String#repeat method (#67) 2018-04-07 18:59:26 +02:00
8770f7b548 New ArrayBuffer/TypedArray; Stdlib restructure; Fix importing stdlib in stdlib; Traverse constructors; Allow initialization of readonly instance fields in constructors 2018-04-07 03:27:22 +02:00
6268b92eba Resolve string instances to the program's string class 2018-04-06 00:19:45 +02:00
70a0123554 Fix some cases in string comparision (#66) 2018-04-05 17:44:17 +02:00
26601dcfb1 Make '===' and '!==' ignore operator overloads
While not semantically equivalent with JS semantics, this appears to be the right thing to do in AS. Also avoids using changetype just for this purpose, which will eventually become considered unsafe.
2018-04-05 02:42:12 +02:00
e790eb757f Add string comparison operator overloads (#64) 2018-04-04 21:50:40 +02:00
164f134053 Even more math (#56)
Remaining implementations of JavaScript's Math functions (except sin/cos/tan), both double (Math) and single (Mathf) precision, ported from musl incl. tests from libc-test, plus some changes to match JS semantics. Also binds fmod to `%` and pow to `**`.
2018-03-30 17:25:54 +02:00
4adb69f73a Binary expression operator overloads for +/==; Check allocation flow in ternary expressions; Cache empty array buffers; Sealed decorator for non-derivable internals 2018-03-23 12:45:29 +01:00
23a7db4dc3 Ensure consistent variable modifiers
'var' is a distinct local or mutable global, 'let' a shared local
2018-03-13 02:32:10 +01:00
423533c6b0 Implement function types / indirect calls / trampolines (#39) 2018-03-12 14:06:39 +01:00
4633fdab96 Update binary expression inference, see #35; Update dependencies 2018-03-01 19:42:07 +01:00
9ef8b162a9 Also lint stdlib 2018-02-25 23:21:32 +01:00
3924aa96ae Fun fact: Can even implement parseInt/I32/I64 using generics, see #19 2018-01-30 06:05:35 +01:00
ab5a938ea0 parseInt compatibility layer around parseI64, see #19 2018-01-30 01:26:38 +01:00
9e3b6f202d Naive parseFloat 2018-01-29 07:42:40 +01:00
d3f22637ed Check radix in parseInt and use constant offsets 2018-01-29 00:33:32 +01:00
002fba3067 Initial parseInt using loads, see #8 2018-01-28 23:42:55 +01:00
b1e7b75ad7 Static operator overloads 2018-01-28 06:18:27 +01:00
5d76ba9437 Wire assertions to global abort, see #8 2018-01-27 16:23:00 +01:00
de066fc128 Preliminary strings
While not well-wrought, it's at least possible now to log some stuff when debugging
2018-01-27 05:35:14 +01:00
ad469ca445 Polyfill move_memory and set_memory and remove Heap 2018-01-14 02:30:20 +01:00
2df318a7ec Implicitly alias stdlib exports as program globals, see #8 2018-01-12 15:36:17 +01:00
fc777b3a89 Builtins rewrite with type parameter inference; Small integer math optimizations; Switchify 2018-01-10 13:09:05 +01:00
d8fa04f910 Operator overload preparations 2018-01-06 10:20:38 +01:00
3add4624c5 Initial instance methods and field layout; More cleanup 2018-01-01 20:27:21 +01:00
4207f6460d Warn on constant locals not being actual constants; Simplify changetype 2017-12-28 17:16:37 +01:00
ad298c7bea Asterisk imports parsing; Pussyfooting around stdlib 2017-12-23 00:48:54 +01:00
666ba54e42 Heap fill/compare; Std string experiments 2017-12-21 10:14:53 +01:00
2720515982 More stdlib setup 2017-12-16 17:54:53 +01:00