From 04f6d5042321d86dc2a812573f3c899d8797447b Mon Sep 17 00:00:00 2001 From: Zalim Bashorov Date: Tue, 25 Nov 2014 17:30:56 +0300 Subject: [PATCH] Minor in JS stdlib: annotate volatile and synchronized as native. Don't generate code for this classes to avoid warnings from some minifiers. Note: volatile and synchronized was reserved word in ECMAScript 2, but is not since ECMAScript 5. --- js/js.libraries/src/core/concurrent.kt | 7 +++++++ 1 file changed, 7 insertions(+) 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()