diff --git a/js/js.translator/testFiles/kotlin_lib.js b/js/js.translator/testFiles/kotlin_lib.js index fd4ba8320f1..48a25bcf9fb 100644 --- a/js/js.translator/testFiles/kotlin_lib.js +++ b/js/js.translator/testFiles/kotlin_lib.js @@ -306,10 +306,15 @@ var kotlin = {set:function (receiver, key, value) { } ); + var ComparatorImpl = Kotlin.$createClass(Kotlin.Comparator, { + initialize: function (comparator) { + this.compare = comparator; + } + } + ); + Kotlin.comparator = function (f) { - var result = Kotlin.$new(Kotlin.Comparator)(); - result.compare = f; - return result; + return Kotlin.$new(ComparatorImpl)(f); }; Kotlin.collectionsMax = function (col, comp) { diff --git a/js/js.translator/testFiles/kotlin_lib_ecma5.js b/js/js.translator/testFiles/kotlin_lib_ecma5.js index 3a66796361f..221727bfe2c 100644 --- a/js/js.translator/testFiles/kotlin_lib_ecma5.js +++ b/js/js.translator/testFiles/kotlin_lib_ecma5.js @@ -66,9 +66,8 @@ var Kotlin = {}; if (initializer != null) { initializer.apply(o, arguments); } - if (initializer == null || !initializer.hasOwnProperty("skipSeal")) { - Object.seal(o); - } + + Object.seal(o); return o; }; } @@ -164,10 +163,6 @@ var Kotlin = {}; } } - if (initializer) { - Object.defineProperty(initializer, "skipSeal", {value: true}); - } - return Kotlin.createClass(parent || null, initializer, descriptors); };