Last active
November 29, 2015 04:54
-
-
Save otarim/e9df7e83334dc14b2758 to your computer and use it in GitHub Desktop.
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
| 'use strict' | |
| var T = function() { | |
| } | |
| var as = async function() { | |
| return new Promise(function(resolve, reject) { | |
| setTimeout(function() { | |
| resolve(1000) | |
| }, 1000) | |
| }) | |
| } | |
| T.prototype = { | |
| constructor: T, | |
| init: async function() { | |
| this.xxoo = await as() | |
| return this | |
| }, | |
| getXXOO: function() { | |
| console.log(this.xxoo) | |
| } | |
| } | |
| var t = new T | |
| ; | |
| (async function() { | |
| (await t.init()).getXXOO() | |
| })() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment