Created
February 9, 2017 11:00
-
-
Save bulentv/47eeec33cacaa7f85b2dfab6156451a0 to your computer and use it in GitHub Desktop.
es6test.js
This file contains 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
"use strict"; | |
function startTest(cb) { | |
setTimeout( () => { | |
let a = 1; | |
if(true) { | |
console.log(a); | |
cb(); | |
} | |
}, 100); | |
} | |
class testClass { | |
constructor() { | |
console.log("constructed"); | |
this._testv = 0; | |
} | |
get testValue() { | |
return 'a-haa, getter? ' + this._testv; | |
} | |
set testValue(v) { | |
this._testv = v + ' <-- sleepin?'; | |
} | |
resetV() { | |
this._testv = -1; | |
this.inc(); | |
} | |
inc() { | |
this._testv++; | |
} | |
start() { | |
let b = 2; | |
setTimeout( () => { | |
startTest( () => { | |
this.inc(); | |
this.inc(); | |
this.inc(); | |
console.log(b); | |
console.log(this.d); | |
console.log(this.testValue); | |
this.testValue = 'zzz'; | |
console.log(this.testValue); | |
this.resetV(); | |
}); | |
}, 500); | |
this.d = 4; | |
} | |
} | |
var t = new testClass(); | |
t.start(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment