diff --git a/js/js.libraries/src/core/concurrent.kt b/js/js.libraries/src/core/concurrent.kt index 800f60e8088..75ebbc1c1ad 100644 --- a/js/js.libraries/src/core/concurrent.kt +++ b/js/js.libraries/src/core/concurrent.kt @@ -18,8 +18,15 @@ package kotlin import kotlin.InlineOption.ONLY_LOCAL_RETURN +// Note: +// Right now we don't want to have neither 'volatile' nor 'synchronized' at runtime, +// so they annotated as 'native' to avoid warnings/errors from some minifiers. +// They was reserved word in ECMAScript 2, but is not since ECMAScript 5. + +native public annotation class volatile +native public annotation class synchronized public inline fun synchronized(lock: Any, [inlineOptions(ONLY_LOCAL_RETURN)] block: () -> R): R = block()