JS: throw error from coroutine marker functions

This commit is contained in:
Alexey Andreev
2017-11-24 12:24:16 +03:00
parent 71b1591044
commit be4e2f96c2
+11
View File
@@ -67,17 +67,28 @@ Kotlin.suspendCall = function(value) {
};
Kotlin.coroutineResult = function(qualifier) {
throwMarkerError();
};
Kotlin.coroutineController = function(qualifier) {
throwMarkerError();
};
Kotlin.coroutineReceiver = function(qualifier) {
throwMarkerError();
};
Kotlin.setCoroutineResult = function(value, qualifier) {
throwMarkerError();
};
function throwMarkerError() {
throw new Error(
"This marker function should never been called. " +
"Looks like compiler did not eliminate it properly. " +
"Please, report an issue if you caught this exception.");
}
Kotlin.getFunctionById = function(id, defaultValue) {
return function() {
return defaultValue;