diff --git a/js/js.translator/testData/maps.js b/js/js.translator/testData/maps.js index cc0fa8a6f43..a87f327fd52 100644 --- a/js/js.translator/testData/maps.js +++ b/js/js.translator/testData/maps.js @@ -746,7 +746,7 @@ /** @constructs */ function () { this.$size = 0; - this.map = {}; + this.map = Object.create(null); }, /** @lends {Kotlin.AbstractPrimitiveHashSet.prototype} */ { @@ -796,69 +796,18 @@ } }); - var PROTO_NAME = "__proto__"; - lazyInitClasses.DefaultPrimitiveHashSet = Kotlin.createClass( function () { return [Kotlin.AbstractPrimitiveHashSet]; }, /** @constructs */ function () { - var superClass = Kotlin.AbstractPrimitiveHashSet; - - superClass.call(this); - this.super = superClass.prototype; - - this.containsProto = false; + Kotlin.AbstractPrimitiveHashSet.call(this); }, /** @lends {Kotlin.DefaultPrimitiveHashSet.prototype} */ { - contains_za3rmp$: function (key) { - var skey = String(key); - if (skey === PROTO_NAME) { - return this.containsProto; - } - - return this.super.contains_za3rmp$.call(this, key); - }, - add_za3rmp$: function (element) { - var skey = String(element); - if (skey === PROTO_NAME) { - var isNewElement = !this.containsProto; - - if (isNewElement) { - this.containsProto = true; - this.$size++; - } - - return isNewElement; - } - - return this.super.add_za3rmp$.call(this, element); - }, - remove_za3rmp$: function (element) { - var skey = String(element); - if (skey === PROTO_NAME) { - var contains = this.containsProto; - - if (contains) { - this.containsProto = false; - this.$size++; - } - - return contains; - } - - return this.super.remove_za3rmp$.call(this, element); - }, - clear: function () { - this.$size = 0; - this.containsProto = false; - this.map = {}; - }, toArray: function () { - var elements = Object.keys(this.map); - return !this.containsProto ? elements : elements.concat(PROTO_NAME); + return Object.keys(this.map); } });