Skip to content

Commit 84d2e11

Browse files
committed
added async await to documentation
1 parent 0eb8025 commit 84d2e11

File tree

4 files changed

+1543
-311
lines changed

4 files changed

+1543
-311
lines changed

core-lib/es6/src/main/java/def/js/Promise.java

+8
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import java.util.function.BiConsumer;
44
import java.util.function.Consumer;
55
import java.util.function.Function;
6+
import java.util.function.Supplier;
67

78
import jsweet.util.Lang;
89

@@ -123,6 +124,10 @@ native public <TResult> Promise<TResult> then(Function<T, TResult> onfulfilled,
123124
* @returns A Promise for the completion of which ever callback is executed.
124125
*/
125126
native public <TResult> Promise<TResult> then(Function<T, TResult> onfulfilled);
127+
128+
native public <TResult> Promise<TResult> then(Supplier<TResult> onfulfilled);
129+
130+
native public Promise<Void> then(Runnable onfulfilled);
126131

127132
native public Promise<Void> then(Consumer<T> onfulfilled);
128133

@@ -164,6 +169,9 @@ native public <TResult> Promise<TResult> thenAsyncWithOnError(Function<T, Promis
164169
@jsweet.lang.Name("then")
165170
native public <TResult> Promise<TResult> thenAsync(Function<T, PromiseLike<TResult>> onfulfilled,
166171
Function<java.lang.Object, TResult> onrejected);
172+
173+
@jsweet.lang.Name("then")
174+
native public <TResult> Promise<TResult> thenAsync(Supplier<PromiseLike<TResult>> onfulfilled);
167175

168176
@jsweet.lang.Name("then")
169177
native public <TResult> Promise<TResult> thenAsync(Function<T, PromiseLike<TResult>> onfulfilled,

doc/header.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
JSweet Language Specifications
22
==============================
33

4-
Version: 2.0.x (snapshot)
4+
Version: 2.x (snapshot)
55

6-
Author: Renaud Pawlak
6+
Author : Renaud Pawlak
7+
8+
Author assistant: Louis Grignon
79

810
JSweet JavaDoc API: http://www.jsweet.org/core-api-javadoc/
911

0 commit comments

Comments
 (0)