質問編集履歴
1
class構文を使用した記載に修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -86,41 +86,43 @@
|
|
86
86
|
|
87
87
|
```js
|
88
88
|
|
89
|
-
as
|
89
|
+
export default class TestClass {
|
90
90
|
|
91
|
-
|
91
|
+
async action(){
|
92
92
|
|
93
|
-
|
93
|
+
await new Promise(function(resolve, reject){
|
94
94
|
|
95
|
-
|
95
|
+
console.log(0);
|
96
96
|
|
97
|
-
|
97
|
+
resolve('a');
|
98
98
|
|
99
|
-
|
99
|
+
})
|
100
100
|
|
101
|
-
|
101
|
+
.then(function(message){
|
102
102
|
|
103
|
-
|
103
|
+
console.log(1);
|
104
104
|
|
105
|
-
|
105
|
+
return message + 'b';
|
106
106
|
|
107
|
-
|
107
|
+
})
|
108
108
|
|
109
|
-
|
109
|
+
.then(function(message){
|
110
110
|
|
111
|
-
console.log(
|
111
|
+
console.log(2);
|
112
112
|
|
113
|
-
|
113
|
+
console.log(message + 'c');
|
114
114
|
|
115
|
-
|
115
|
+
return message;
|
116
116
|
|
117
|
+
});
|
118
|
+
|
117
|
-
console.log(3);
|
119
|
+
console.log(3);
|
120
|
+
|
121
|
+
}
|
118
122
|
|
119
123
|
}
|
120
124
|
|
121
|
-
|
122
|
-
|
123
|
-
var result = await action();
|
125
|
+
var result = await new TestClass().action();
|
124
126
|
|
125
127
|
console.log("4");
|
126
128
|
|