Commit Graph

89 Commits

Author SHA1 Message Date
Onoshko Dan
8e3914de57 Var and func def modificators.
covert int Math.some() => 123;

to

Object.defineProperty(Math, "some", {
    value: function some() {
        return 123;
    },
    writable: true
});
2014-08-16 13:21:45 +07:00
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
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
bd86f0d5ce type check progress 2014-07-29 01:51:41 +07:00
Onoshko Dan
c635d9e1f1 Some info was added 2014-07-03 01:07:41 +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
1382b1c8e9 :: prototype accessor done. npm published. 2014-05-23 17:14:16 +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
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
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
e1a702e9a1 new syntax added
`some?? || isset some`, `Type some, some2`, `a ? b`
2014-04-19 01:27:47 +07:00
Onoshko Dan
ea892ef28c Refactoring over! 2014-04-17 23:21:45 +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
8f35a363d9 AST_Catch shouldn't really inherit from AST_Scope. Fix #363
I hereby acknowledge that figure_out_scope has become a mess.
2013-12-05 13:30:29 +02:00
Mihai Bazon
d2190c2bf3 Properly scope catch identifier when --screw-ie8
Fix #344
2013-11-28 16:43:30 +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
cb9d16fbe4 minor 2013-09-06 09:52:56 +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
02a84385a0 Don't swap binary ops when "use asm" is in effect.
Refs #167
2013-06-07 12:52:09 +03:00
Jake Harding
478bf4dbdd Add support for enclose option. Closes #139. 2013-03-24 11:11:23 +02:00
David Glasser
1529ab965a Fix output for arrays containing undefined values.
1b6bcca7 was a first attempt at this. That commit made Uglify stop replacing
holes with undefined, but instead it started replacing undefined with
holes. This is slightly problematic, because there is a difference between a
hole and an undefined value. More problematically, it changed [1,undefined] to
[1,] which generally doesn't even parse as a hole (just as a trailing comma), so
it didn't even preserve the length of the array!

Instead, parse holes as their own special AST node which prints invisibly.
2013-01-17 11:36:10 +02:00
Mihai Bazon
13c4dfcabd fix #55 2012-11-24 10:02:08 +02:00
Mihai Bazon
1e5e13ed81 AST_LabelRef no longer inherits from AST_SymbolRef 2012-11-08 15:39:14 +02:00
Mihai Bazon
5276a4a873 add AST_Accessor and AST_SymbolAccessor node types
AST_Accessor will represent the function for a setter or getter.  Since they
are not mangleable, and they should not introduce a name in scope, we have a
new node for their name (AST_SymbolAccessor) which doesn't inherit from
AST_SymbolDeclaration.

fix #37
2012-11-07 12:43:27 +02:00
Mihai Bazon
30faaf13ed more sequence optimizations (lift some sequences above binary/unary expressions so that we can avoid parens) 2012-10-22 11:58:06 +03:00
Mihai Bazon
afb7faa6fa more optimizations for some break/continue cases 2012-10-18 15:14:57 +03:00
Mihai Bazon
1b6f8d463f remove the $self hack
operations are destructive anyway, so there's no point to clone the nodes in
the transformer.  speed++
2012-10-12 11:07:35 +03:00
Mihai Bazon
72cb5328ee fix in_boolean_context() (two tests were broken) 2012-10-12 10:49:41 +03:00
Mihai Bazon
172aa7a93c cleanup
- use prototype-less objects where feasible (minor speed improvement)
- get rid of HOP
2012-10-11 11:07:42 +03:00
Mihai Bazon
9cdaed9860 fix node name 2012-10-10 23:16:40 +03:00
Mihai Bazon
dacce1b1fa seems cleaner if AST_Label doesn't inherit from AST_SymbolDeclaration 2012-10-10 11:37:51 +03:00
Mihai Bazon
f26f3b44bc small improvements in wrap_commonjs:
- use MAP.splice instead of a BlockStatement to inject code (avoids some
  warnings in the linter)
- use the original symbol in exports, so that we get the proper source mapping
2012-10-10 11:28:05 +03:00
Mihai Bazon
a84d07e312 add AST_Infinity node 2012-10-09 18:35:53 +03:00
Mihai Bazon
1b0aab2ce9 added $propdoc to AST nodes and some cleanups
hopefully we can make the AST documentation self-generating
2012-10-09 18:20:39 +03:00
Mihai Bazon
9ead49641d minor AST cleanup (AST_BlockStatement may inherit from AST_Block) 2012-10-09 13:59:17 +03:00
Mihai Bazon
e1862cd36f add --ast-help
displays a rather cruel description of the AST classes, derived
directly from the node definitions.
2012-10-09 13:21:21 +03:00
Mihai Bazon
dd8286bce1 added --self to easily get a browser-runnable version of UglifyJS 2012-10-08 12:55:18 +03:00
Mihai Bazon
11863d6f9a more cleanup (dropped AST_SwitchBlock) 2012-10-03 15:52:31 +03:00
Mihai Bazon
3412498795 AST cleanup (dropped AST_StatementBase) 2012-10-03 15:41:11 +03:00