51 Commits

Author SHA1 Message Date
Max Graey
abf3de9076 Fix implicit string to bool conversion (#567) 2019-03-31 20:00:54 +02:00
Max Graey
cdf40578b6 Refactor slices for better compliance (#430) 2019-02-27 21:51:07 +01:00
Max Graey
0041572052 Reuse respective opposite overload in std/string comparisions (#479) 2019-02-21 00:30:05 +01:00
Daniel Wirtz
0c64f21250
Rework resolver (#489)
* Rework IR and resolver to use nested lookup tables
* Integrate types into IR
* Make components prefer IR, slimmed down AST
* Implement `export *`
* Add `@lazy` annotation and remove `--noTreeShaking`
* Add `@start` annotation and remove magic `main`
* Related refactoring, cleanup and docs
2019-02-21 00:11:22 +01:00
Max Graey
54b02c287c Fix functional Array & String methods and avoid buffer caching (#415) 2019-01-17 01:34:09 +01:00
LiaoPeng
201bd5f2b1 Implement String#slice (#404) 2019-01-10 12:10:23 +01:00
Daniel Wirtz
ebae7cbd73
Implement optional type parameters (#360)
* Add a NATIVE<T> macro type to simplify use of a native WebAssembly type
* Add default type parameters for internal helpers for explicit loads and stores
* Unify loadUnsafe/loadUnsafeWithOffset etc. into one
* Renamed loadUnsafe etc. into just LOAD, like a macro
* Implement parsing of index signatures, but ignore them, for properly linting code
* Refactor TypedArray<T> to use macros
2018-12-07 14:33:32 +01:00
Max Graey
711f73b15d Implement String#split (#301) 2018-10-18 19:05:35 +02:00
dcodeIO
b7e7be20cf Add String.fromUTF8 helper (see #291); Update dist files 2018-10-03 00:49:56 +02:00
Max Graey
2874fb9d8a Add trimStart/End aliases (#287) 2018-09-30 22:21:34 +02:00
dcodeIO
4498b28442 Use outer-most identifier when resolving queued exports, fixes #248 2018-09-09 03:51:29 +02:00
Daniel Wirtz
dc0f271fc2
Initial GC integration (#196) 2018-08-02 18:23:02 +02:00
Max Graey
671121bf70 Implement String#padStart/padEnd; Refactor internal string copy, compare and repeat (#171) 2018-07-25 16:25:53 +02:00
Max Graey
298a8f1688 Add String.fromCodePoint and 16-bit string compare (#174) 2018-07-23 14:32:55 +02:00
dcodeIO
a1b75b69b7 Rename memory instructions; Rework constant handling 2018-07-18 23:49:32 +02:00
Max Graey
d7c1c608bd Implement itoa32/64 for base 10 (#151) 2018-07-13 15:40:37 +02:00
Max Graey
5ce57a6434 Fix default fromIndex in String#lastIndexOf (#165) 2018-07-13 13:30:48 +02:00
Max Graey
365884ff73 Add String#lastIndexOf and improve tests (#163) 2018-07-10 03:31:51 +02:00
dcodeIO
51ede113dd Fix possible out of bounds read in string UTF8 conversion 2018-05-23 15:37:09 +02:00
dcodeIO
33b10e347b Properly resolve top level enums to i32s, see #116 2018-05-22 12:06:03 +02:00
dcodeIO
ea0eb7f1a5 Add a simple UTF8 converter, i.e. for calling C++ APIs; Fix disabling 'abort' entirely 2018-05-21 23:14:47 +02:00
Max Graey
6d0b5d92c2 Minor string comparision optimizations (#77) 2018-04-16 23:02:55 +02:00
Max Graey
b7ef21950b Add String#repeat method (#67) 2018-04-07 18:59:26 +02:00
dcodeIO
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
dcodeIO
6268b92eba Resolve string instances to the program's string class 2018-04-06 00:19:45 +02:00
Max Graey
70a0123554 Fix some cases in string comparision (#66) 2018-04-05 17:44:17 +02:00
dcodeIO
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
Max Graey
e790eb757f Add string comparison operator overloads (#64) 2018-04-04 21:50:40 +02:00
Daniel Wirtz
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
dcodeIO
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
dcodeIO
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
Daniel Wirtz
423533c6b0
Implement function types / indirect calls / trampolines (#39) 2018-03-12 14:06:39 +01:00
dcodeIO
4633fdab96 Update binary expression inference, see #35; Update dependencies 2018-03-01 19:42:07 +01:00
dcodeIO
9ef8b162a9 Also lint stdlib 2018-02-25 23:21:32 +01:00
dcodeIO
3924aa96ae Fun fact: Can even implement parseInt/I32/I64 using generics, see #19 2018-01-30 06:05:35 +01:00
dcodeIO
ab5a938ea0 parseInt compatibility layer around parseI64, see #19 2018-01-30 01:26:38 +01:00
dcodeIO
9e3b6f202d Naive parseFloat 2018-01-29 07:42:40 +01:00
dcodeIO
d3f22637ed Check radix in parseInt and use constant offsets 2018-01-29 00:33:32 +01:00
dcodeIO
002fba3067 Initial parseInt using loads, see #8 2018-01-28 23:42:55 +01:00
dcodeIO
b1e7b75ad7 Static operator overloads 2018-01-28 06:18:27 +01:00
dcodeIO
5d76ba9437 Wire assertions to global abort, see #8 2018-01-27 16:23:00 +01:00
dcodeIO
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
dcodeIO
ad469ca445 Polyfill move_memory and set_memory and remove Heap 2018-01-14 02:30:20 +01:00
dcodeIO
2df318a7ec Implicitly alias stdlib exports as program globals, see #8 2018-01-12 15:36:17 +01:00
dcodeIO
fc777b3a89 Builtins rewrite with type parameter inference; Small integer math optimizations; Switchify 2018-01-10 13:09:05 +01:00
dcodeIO
d8fa04f910 Operator overload preparations 2018-01-06 10:20:38 +01:00
dcodeIO
3add4624c5 Initial instance methods and field layout; More cleanup 2018-01-01 20:27:21 +01:00
dcodeIO
4207f6460d Warn on constant locals not being actual constants; Simplify changetype 2017-12-28 17:16:37 +01:00
dcodeIO
ad298c7bea Asterisk imports parsing; Pussyfooting around stdlib 2017-12-23 00:48:54 +01:00
dcodeIO
666ba54e42 Heap fill/compare; Std string experiments 2017-12-21 10:14:53 +01:00