Commit Graph

94 Commits

Author SHA1 Message Date
Onoshko Dan
aec283f0b4 operator ? to sign an argument as not-required
int sqr(int x) => x ** 2;

sqr(2); // 4
sqr();  // Exception

int sqrt(int x?) => x ** 2;
sqr();  // NaN
2014-08-15 04:19:06 +07:00
Onoshko Dan
c9f4a2cd12 Conditional Accessor is done. 2014-08-15 03:34:04 +07:00
Onoshko Dan
c3df8f1d3f Progress
- Use inline `isset` expression instead function. status: done
- Use inline `is`. status: done
- `some is NaN` to `isNaN(some)`. status: done
- operator `?` instead `isset`. status: done
- rename runtime prefix `$_cola` to `_ColaRuntime$$`. status: done
- dotal names of refs: done
2014-08-14 20:05:38 +07:00
Onoshko Dan
8d600533ac Arrow functions bug-fix 2014-07-29 14:32:56 +07:00
Onoshko Dan
e6a49779ae bug fix 2014-07-29 01:51:23 +07:00
Onoshko Dan
14eb63b057 Functions translation bug fix 2014-07-03 01:08:11 +07:00
Onoshko Dan
c72d6f0a4a Prepare to typing. 2014-06-12 02:14:36 +07:00
Onoshko Dan
3e4589b331 Prepare code to the static typing. 2014-06-01 03:14:13 +07:00
Onoshko Dan
965d94c636 Fixes. 2014-05-30 01:33:48 +07:00
Onoshko Dan
7f93a474c9 "use asmjs" -> "use asm" fix 2014-05-29 01:11:30 +07:00
Onoshko Dan
9bb898f87b for-in bug fix 2014-05-27 19:10:44 +07:00
Onoshko Dan
1382b1c8e9 :: prototype accessor done. npm published. 2014-05-23 17:14:16 +07:00
Onoshko Dan
00623e5e4c Browser-Cola added. 2014-05-22 22:44:11 +07:00
Onoshko Dan
fb8ccc644f @require and @include done. 2014-05-22 01:01:32 +07:00
Onoshko Dan
744ecd3a8e Console util done. 2014-05-20 00:29:01 +07:00
Onoshko Dan
3a8f96a40e switch done 2014-05-19 16:58:17 +07:00
Onoshko Dan
dd22a18eb0 Multiple assignment done. 2014-05-16 19:27:51 +07:00
Onoshko Dan
af6f8ebf7b Cascade operator added, function arguments fixed. 2014-05-03 18:40:47 +07:00
Onoshko Dan
ff64dec3f7 Demo updated. 2014-04-28 15:20:12 +07:00
Onoshko Dan
50ff6c272c Functions features completed. 2014-04-28 03:30:25 +07:00
Onoshko Dan
f88a7e12d9 Array sugar added. 2014-04-22 20:33:43 +07:00
Onoshko Dan
b2bffc40cd Array arr[] operator added. 2014-04-21 01:56:47 +07:00
Onoshko Dan
a8f26fdf33 Arrow functions added. 2014-04-20 22:38:58 +07:00
Onoshko Dan
7bdb095cee New features added.
Operator `clone` and anonymous function definition `(){}`.
2014-04-20 14:31:03 +07:00
Onoshko Dan
2cff0f2f3e new declaration of functions added 2014-04-20 01:04:11 +07:00
Onoshko Dan
bf3979f327 is_js fix 2014-04-19 01:45:18 +07:00
Onoshko Dan
e1a702e9a1 new syntax added
`some?? || isset some`, `Type some, some2`, `a ? b`
2014-04-19 01:27:47 +07:00
Onoshko Dan
2f11d32a70 Adding std functions if need. 2014-04-18 13:10:20 +07:00
Onoshko Dan
d461f9d927 parse.js refectory is done 2014-04-17 17:10:18 +07:00
Onoshko Dan
db5ea25e30 Refactoring
Step 2
2014-04-17 01:39:27 +07:00
Onoshko Dan
10db7a5ef4 Refactoring
step 1
2014-04-16 23:43:40 +07:00
Onoshko Dan
a2f7a07c11 license updated 2014-04-15 19:57:14 +07:00
Onoshko Dan
b7d220ae12 First step is done.
index.html - playground
2014-04-15 17:52:01 +07:00
Onoshko Dan
b5dd0a9774 Going to ColaScript!!!
Start work on ColaScript translator.
2014-04-14 10:35:26 +07:00
Mihai Bazon
1d0127de21 Fix end token for conditionals. Close #404 2014-01-21 10:38:59 +02:00
Mihai Bazon
aa9de76370 Mark yield as reserved word. Close #375. 2013-12-22 20:52:19 +02:00
Mihai Bazon
c5ed2292bf Fix parsing setters/getters (allow keywords for name).
The "key" property was always "set" or "get", which didn't make much sense.
Now it'll be the actual name of the setter/getter (AST_Node), and the
AST_Accessor object itself, which represents the function, won't store any
name.

Close #319
2013-10-30 11:50:22 +02:00
Mihai Bazon
bea3d90771 minor 2013-10-30 09:10:56 +02:00
David Glasser
bb0a762d12 Only allow identifier start characters at the beginning of identifiers.
Without this fix, the following source:

   x = {"\u200c": 42};

would incorrectly be converted into a quoteless key. But while \u200c is allowed
to be in identifiers, it cannot be at the beginning, as per ES5.

(For example, the SockJS client library doesn't work under uglify starting with
d9ad3c7c.)
2013-10-03 17:02:19 -07:00
Mihai Bazon
7c10b25346 Support HTML5 comment syntax (enabled by default!)
See http://javascript.spec.whatwg.org/#comment-syntax
    https://github.com/mishoo/UglifyJS/issues/503
    https://github.com/marijnh/acorn/issues/62
2013-09-06 09:54:30 +03:00
Mihai Bazon
5d8da864c5 Fix names. 2013-09-02 19:38:00 +03:00
Mihai Bazon
85b527ba3d Disallow continue referring to a non-IterationStatement. Fix #287
Simplifies handling of labels (their definition/references can be easily
figured out at parse time, no need to do it in `figure_out_scope`).
2013-09-02 19:36:16 +03:00
Mihai Bazon
1c6efdae34 Better fix for #286 2013-09-02 11:36:48 +03:00
Mihai Bazon
b0ca896d98 Fix parsing a.case /= 1
Close #286
2013-09-02 11:09:54 +03:00
Mihai Bazon
78a217b94c Fix parsing regexp after unary-prefix operator
++/x/.y

Fix #284
2013-09-02 09:56:27 +03:00
Mihai Bazon
193049af19 Revert previous patch, it was no good. 2013-07-15 11:59:23 +03:00
Mihai Bazon
4a0bab0fa3 Add "position" option to parser, to specify initial pos/line/col
(for parsing embedded scripts)
2013-07-15 11:27:11 +03:00
Mihai Bazon
fc9ba323c4 Fix typo.
Close #239
2013-07-12 09:56:58 +03:00
Mihai Bazon
ca3388cf5a Add --expr, an option to parse a single expression (suitable for JSON) 2013-05-15 13:27:23 +03:00
Mihai Bazon
d56ebd7d7b Fix a["1_1"]
Close #204
2013-05-14 10:42:34 +03:00