Before

…lines 1–5 unchanged (5 lines)
6package org.jetbrains.kotlin.platform.js
7
8import org.jetbrains.kotlin.platform.JsPlatform
9import org.jetbrains.kotlin.platform.TargetPlatform
10import org.jetbrains.kotlin.platform.isJs as _isJs
11
12@Suppress("DEPRECATION_ERROR")
13object JsPlatforms {
14 object DefaultSimpleJsPlatform : JsPlatform()
15
16 @Deprecated(
17 message = "Should be accessed only by compatibility layer, other clients should use 'defaultJsPlatform'",
18 level = DeprecationLevel.ERROR
19 )
20 object CompatJsPlatform : TargetPlatform(setOf(DefaultSimpleJsPlatform)),
21 // Needed for backward compatibility, because old code uses INSTANCEOF checks instead of calling extensions
22 org.jetbrains.kotlin.js.resolve.JsPlatform {
23 override val platformName: String
24 get() = "JS"
25 }
26
27 val defaultJsPlatform: TargetPlatform
28 get() = CompatJsPlatform
29
30 val allJsPlatforms: List<TargetPlatform> = listOf(defaultJsPlatform)
31}
32
33@Deprecated(
34 "For binary compatibility, please use org.jetbrains.kotlin.platform.isJs",
35 ReplaceWith("this.isJs()", "org.jetbrains.kotlin.platform.isJs")
36)
37fun TargetPlatform?.isJs(): Boolean = _isJs()
38

After

…lines 1–4 unchanged (4 lines)
5
6package org.jetbrains.kotlin.platform.js
7
8import org.jetbrains.kotlin.platform.JsPlatform
9import org.jetbrains.kotlin.platform.TargetPlatform
10import org.jetbrains.kotlin.platform.isJs as _isJs
11
12object JsPlatforms {
13 object DefaultSimpleJsPlatform : JsPlatform()
14
15 private object CompatJsPlatform : TargetPlatform(setOf(DefaultSimpleJsPlatform))
16
17 val defaultJsPlatform: TargetPlatform
18 get() = CompatJsPlatform
19
20 val allJsPlatforms: List<TargetPlatform> = listOf(defaultJsPlatform)
21}
22

Before

source_file
block_comment "/*\n * Copyright 2010-2019 JetBrains s.r.o. Use of this sourc"...
package_header
package "package"
qualified_identifier
identifier "org"
. "."
identifier "jetbrains"
. "."
identifier "kotlin"
. "."
identifier "platform"
. "."
identifier "js"
import
import "import"
qualified_identifier
identifier "org"
. "."
identifier "jetbrains"
. "."
identifier "kotlin"
. "."
identifier "platform"
. "."
identifier "JsPlatform"
import
import "import"
qualified_identifier
identifier "org"
. "."
identifier "jetbrains"
. "."
identifier "kotlin"
. "."
identifier "platform"
. "."
identifier "TargetPlatform"
import
import "import"
qualified_identifier
identifier "org"
. "."
identifier "jetbrains"
. "."
identifier "kotlin"
. "."
identifier "platform"
. "."
identifier "isJs"
as "as"
identifier "_isJs"
annotated_expression
annotation
@ "@"
user_type
identifier "Suppress"
parenthesized_expression
( "("
string_literal
" "\""
string_content "DEPRECATION_ERROR"
" "\""
) ")"
object_declaration
object "object"
identifier "JsPlatforms"
class_body
{ "{"
object_declaration
object "object"
identifier "DefaultSimpleJsPlatform"
: ":"
delegation_specifiers
delegation_specifier
constructor_invocation
user_type
identifier "JsPlatform"
value_arguments
( "("
) ")"
object_declaration
modifiers
annotation
@ "@"
constructor_invocation
user_type
identifier "Deprecated"
value_arguments
( "("
value_argument
identifier "message"
= "="
string_literal
" "\""
string_content "Should be accessed only by compatibility layer, other client"...
" "\""
, ","
value_argument
identifier "level"
= "="
navigation_expression
identifier "DeprecationLevel"
. "."
identifier "ERROR"
) ")"
object "object"
identifier "CompatJsPlatform"
: ":"
delegation_specifiers
delegation_specifier
constructor_invocation
user_type
identifier "TargetPlatform"
value_arguments
( "("
value_argument
call_expression
identifier "setOf"
value_arguments
( "("
value_argument
identifier "DefaultSimpleJsPlatform"
) ")"
) ")"
, ","
line_comment "// Needed for backward compatibility, because old code uses "...
delegation_specifier
user_type
identifier "org"
. "."
identifier "jetbrains"
. "."
identifier "kotlin"
. "."
identifier "js"
. "."
identifier "resolve"
. "."
identifier "JsPlatform"
class_body
{ "{"
property_declaration
modifiers
member_modifier
override "override"
val "val"
variable_declaration
identifier "platformName"
: ":"
user_type
identifier "String"
getter
get "get"
( "("
) ")"
function_body
= "="
string_literal
" "\""
string_content "JS"
" "\""
} "}"
property_declaration
val "val"
variable_declaration
identifier "defaultJsPlatform"
: ":"
user_type
identifier "TargetPlatform"
getter
get "get"
( "("
) ")"
function_body
= "="
identifier "CompatJsPlatform"
property_declaration (+21 nodes collapsed)
} "}"
function_declaration
modifiers
annotation
@ "@"
constructor_invocation
user_type
identifier "Deprecated"
value_arguments
( "("
value_argument
string_literal
" "\""
string_content "For binary compatibility, please use org.jetbrains.kotlin.pl"...
" "\""
, ","
value_argument
call_expression
identifier "ReplaceWith"
value_arguments
( "("
value_argument
string_literal
" "\""
string_content "this.isJs()"
" "\""
, ","
value_argument
string_literal
" "\""
string_content "org.jetbrains.kotlin.platform.isJs"
" "\""
) ")"
) ")"
fun "fun"
nullable_type
user_type
identifier "TargetPlatform"
? "?"
. "."
identifier "isJs"
function_value_parameters
( "("
) ")"
: ":"
user_type
identifier "Boolean"
function_body
= "="
call_expression
identifier "_isJs"
value_arguments
( "("
) ")"

After

source_file
block_comment "/*\n * Copyright 2010-2019 JetBrains s.r.o. Use of this sourc"...
package_header
package "package"
qualified_identifier
identifier "org"
. "."
identifier "jetbrains"
. "."
identifier "kotlin"
. "."
identifier "platform"
. "."
identifier "js"
import
import "import"
qualified_identifier
identifier "org"
. "."
identifier "jetbrains"
. "."
identifier "kotlin"
. "."
identifier "platform"
. "."
identifier "JsPlatform"
import
import "import"
qualified_identifier
identifier "org"
. "."
identifier "jetbrains"
. "."
identifier "kotlin"
. "."
identifier "platform"
. "."
identifier "TargetPlatform"
import
import "import"
qualified_identifier
identifier "org"
. "."
identifier "jetbrains"
. "."
identifier "kotlin"
. "."
identifier "platform"
. "."
identifier "isJs"
as "as"
identifier "_isJs"
object_declaration
object "object"
identifier "JsPlatforms"
class_body
{ "{"
object_declaration
object "object"
identifier "DefaultSimpleJsPlatform"
: ":"
delegation_specifiers
delegation_specifier
constructor_invocation
user_type
identifier "JsPlatform"
value_arguments
( "("
) ")"
object_declaration
modifiers
visibility_modifier
private "private"
object "object"
identifier "CompatJsPlatform"
: ":"
delegation_specifiers
delegation_specifier
constructor_invocation
user_type
identifier "TargetPlatform"
value_arguments
( "("
value_argument
call_expression
identifier "setOf"
value_arguments
( "("
value_argument
identifier "DefaultSimpleJsPlatform"
) ")"
) ")"
property_declaration
val "val"
variable_declaration
identifier "defaultJsPlatform"
: ":"
user_type
identifier "TargetPlatform"
getter
get "get"
( "("
) ")"
function_body
= "="
identifier "CompatJsPlatform"
property_declaration (+21 nodes collapsed)
} "}"