All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.com.dokar.quickjs.binding.JsObject.kt Maven / Gradle / Ivy

The newest version!
package com.dokar.quickjs.binding

/**
 * Create a delegate and mark the map as a JavaScript object.
 */
fun Map.toJsObject(): JsObject = JsObject(this)

/**
 * The delegate of a property [Map] represents a JavaScript object.
 */
class JsObject(private val map: Map) : Map by map {
    override fun equals(other: Any?): Boolean {
        if (this === other) return true
        if (other !is JsObject) return false

        if (map != other.map) return false

        return true
    }

    override fun hashCode(): Int {
        return map.hashCode()
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy