This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@globalPrivate | |
function next() { | |
} | |
@globalPrivate | |
function return() { | |
} | |
@globalPrivate | |
function throw() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const objWithIterator = { | |
[Symbol.iterator]() { | |
return { | |
next: function() { | |
console.log('do next'); | |
return {done: false, value: 'foo'}; | |
}, | |
return: function() { | |
console.log('do return'); | |
return {done: true, value: 'foo'}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const myInterface = Symbol('myInterface'); | |
export default myInterface; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function fakeGen() { | |
return { | |
[Symbol.iterator]: {} | |
} | |
} | |
let [...x] = fakeGen(); | |
// We need error that [Symbol.iterator] is not callable |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function foo () { retur\u006E 'boo'; } | |
// SyntaxError: Keyword must not contain escaped character |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ge\u006Enetic = 'ABCD' | |
conosle.log(ge\u006Enetic); | |
conosle.log(gennetic); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ಠ_ಠ = 15; | |
ಠ_ಠ = ಠ_ಠ + 10; | |
console.log(ಠ_ಠ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ngAsync from 'ng-async.decorator'; | |
class FooController { | |
..... | |
@ngAsync() | |
async doFoo() { | |
this.asyncResult = await this.loadData(); | |
this.status = 'loaded'; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import decoratorHelper from 'decorator.helper'; | |
// Current decorator allow async function to be used in angular | |
// without adding unnecessary digest calls | |
const ngAync = function () { | |
return function (target, key, descriptor) { | |
const fn = descriptor.value; | |
descriptor.value = function () { | |
const result = fn.apply(this, arguments); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const _fooService = new WeakMap(); | |
class FooController { | |
constructor(fooService) { | |
this.name = 'fooController'; | |
_fooService.set(this, fooService); | |
this.title = 'Show data'; |