Repository: joernio/joern (scala)

Issue:
[jssrc2cpg] ECMA Types are Detected as Internal Types
Types such as:
* `ANY`
* `__ecma.Number`
* `__ecma.String`

Contain `.isExternal = false` property.

Pull request description:
When built-in types are created, they are set as external, to be consistent with other frontends.

Resolves #2079

Patch:
diff --git a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/BuiltinTypesPass.scala b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/BuiltinTypesPass.scala
index 717c1f0c10af..5ac7eb882b0b 100644
--- a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/BuiltinTypesPass.scala
+++ b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/BuiltinTypesPass.scala
@@ -26,7 +26,7 @@ class BuiltinTypesPass(cpg: Cpg) extends CpgPass(cpg) {
       val typeDecl = NewTypeDecl()
         .name(typeName)
         .fullName(typeName)
-        .isExternal(false)
+        .isExternal(true)
         .astParentType(NodeTypes.NAMESPACE_BLOCK)
         .astParentFullName(Defines.GLOBAL_NAMESPACE)
         .order(index + 1)


Test patch:
diff --git a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/BuiltinTypesPassTest.scala b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/BuiltinTypesPassTest.scala
index 5c22bbaa1072..85b3125482f2 100644
--- a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/BuiltinTypesPassTest.scala
+++ b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/BuiltinTypesPassTest.scala
@@ -17,7 +17,7 @@ class BuiltinTypesPassTest extends AbstractPassTest {
       Defines.JSTYPES.foreach { (typeName: String) =>
         val List(typeDeclNode) = cpg.typeDecl(typeName).l
         typeDeclNode.fullName shouldBe typeName
-        typeDeclNode.isExternal shouldBe false
+        typeDeclNode.isExternal shouldBe true
         typeDeclNode.filename shouldBe "builtintypes"
 
         cpg.namespaceBlock.astChildren.l should contain(typeDeclNode)