Artem S. Povalyukhin
Artem S. Povalyukhin
1. Handle arguments containing path strings in one place: https://github.com/nginx/njs/commit/1e9f7f506472cb7f1ae218681b319bdd279bb1ec
now is parsed as named function expression, so the code below does not work: ```js export default function tropical() { } tropical.prototype.sum = function(a, b) { return a < b...
[[[OwnPropertyKeys]]](https://tc39.es/ecma262/#sec-ordinaryownpropertykeys) njs: ```js >> Object.getOwnPropertyNames([1,2,3].reduce((a,x,i,s) => { a[s.length - i] = x; a['s' + (s.length - i)] = x; return a; }, {})) [ '3', 's3', '2', 's2', '1', 's1'...
```js console.log(1,...[2,3,4], 5, 6) ``` http://www.ecma-international.org/ecma-262/6.0/#sec-argument-lists-runtime-semantics-argumentlistevaluation http://www.ecma-international.org/ecma-262/9.0/#sec-argument-lists
```js > var [a, b, ...c] = [1,2,3,4] undefined > [a,b,c] [ 1, 2, [ 3, 4 ] ] > var { 1:x, 2:y, length } = [1,2,3,4] undefined >...
```js // "in" ")" >> var a = [1,2,3] undefined >> for (var x in a); undefined >> for (var x in 1,a); undefined >> for (x in a); undefined...
```js > function *g(x) { return x; } undefined > var result = g(42); undefined > result Object [Generator] {} > result.next() { value: 42, done: true } > result.next()...
[10.2 Types of Source Code](https://tc39.github.io/ecma262/#sec-types-of-source-code) [15.1 Scripts](https://tc39.github.io/ecma262/#sec-scripts) [15.2 Modules](https://tc39.github.io/ecma262/#sec-modules) according to the specs above, the ```import``` statement is restricted to module code only. so, if we want to use it...
```js console.log.apply(console, [1,...[2,3,4], 5, 6]) ``` http://www.ecma-international.org/ecma-262/9.0/#sec-array-initializer
```js > console.log({ a: 1, ...{ a: 2, b: 2}, b: 3 }) { a: 2, b: 3 } undefined > console.log({ ...'it is funny' }) { '0': 'i', '1':...