IDL2K: properly handle clash or val and var attributes
This commit is contained in:
@@ -33,12 +33,14 @@ import org.w3c.xhr.*
|
|||||||
set(value) = noImpl
|
set(value) = noImpl
|
||||||
open val rootElement: SVGSVGElement?
|
open val rootElement: SVGSVGElement?
|
||||||
get() = noImpl
|
get() = noImpl
|
||||||
open val title: String
|
var title: String
|
||||||
get() = noImpl
|
get() = noImpl
|
||||||
|
set(value) = noImpl
|
||||||
open val referrer: String
|
open val referrer: String
|
||||||
get() = noImpl
|
get() = noImpl
|
||||||
open val domain: String
|
var domain: String
|
||||||
get() = noImpl
|
get() = noImpl
|
||||||
|
set(value) = noImpl
|
||||||
open val activeElement: Element?
|
open val activeElement: Element?
|
||||||
get() = noImpl
|
get() = noImpl
|
||||||
open val location: Location?
|
open val location: Location?
|
||||||
|
|||||||
@@ -274,6 +274,18 @@ private fun <F, T> Pair<F, F>.map(block: (F) -> T) = block(first) to block(secon
|
|||||||
private fun Pair<Type, Type>.betterType() = if (first is DynamicType || first is AnyType) first else second
|
private fun Pair<Type, Type>.betterType() = if (first is DynamicType || first is AnyType) first else second
|
||||||
private fun Pair<String, String>.betterName() = if (((0..9).map(Int::toString) + listOf("arg")).none { first.toLowerCase().contains(it) }) first else second
|
private fun Pair<String, String>.betterName() = if (((0..9).map(Int::toString) + listOf("arg")).none { first.toLowerCase().contains(it) }) first else second
|
||||||
|
|
||||||
|
private fun merge(a: AttributeKind, b: AttributeKind): AttributeKind {
|
||||||
|
if (a == b) {
|
||||||
|
return a
|
||||||
|
}
|
||||||
|
|
||||||
|
if (a == AttributeKind.VAR || b == AttributeKind.VAR) {
|
||||||
|
return AttributeKind.VAR
|
||||||
|
}
|
||||||
|
|
||||||
|
return a
|
||||||
|
}
|
||||||
|
|
||||||
private fun merge(a: GenerateAttribute, b: GenerateAttribute): GenerateAttribute {
|
private fun merge(a: GenerateAttribute, b: GenerateAttribute): GenerateAttribute {
|
||||||
require(a.name == b.name)
|
require(a.name == b.name)
|
||||||
|
|
||||||
@@ -287,7 +299,7 @@ private fun merge(a: GenerateAttribute, b: GenerateAttribute): GenerateAttribute
|
|||||||
type,
|
type,
|
||||||
a.initializer ?: b.initializer,
|
a.initializer ?: b.initializer,
|
||||||
a.getterSetterNoImpl || b.getterSetterNoImpl,
|
a.getterSetterNoImpl || b.getterSetterNoImpl,
|
||||||
a.kind,
|
merge(a.kind, b.kind),
|
||||||
a.override,
|
a.override,
|
||||||
a.vararg,
|
a.vararg,
|
||||||
a.static
|
a.static
|
||||||
|
|||||||
Reference in New Issue
Block a user