[Wasm] Add internal JsPrimitive annotation
Before external classes could only represent JS object types and are type-checked with `instanceof`. @JsPrimitive allows external classes to represent primitive types with `typeof` checks.
This commit is contained in:
committed by
Space Team
parent
1e91fe155b
commit
d6886d69ec
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package kotlin.wasm.internal
|
||||
|
||||
/**
|
||||
* Annotated external classes correspond to JS primitive type.
|
||||
* @param type is a result of JS `typeof` operator applied to this type.
|
||||
*/
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
internal annotation class JsPrimitive(val type: String)
|
||||
Reference in New Issue
Block a user