Browse Source

[js] test if String.__class__ is enumerable (closes #10410)

Aleksandr Kuzmenko 3 years ago
parent
commit
bd2c45ae7c
1 changed files with 12 additions and 0 deletions
  1. 12 0
      tests/unit/src/unit/issues/Issue10410.hx

+ 12 - 0
tests/unit/src/unit/issues/Issue10410.hx

@@ -0,0 +1,12 @@
+package unit.issues;
+
+class Issue10410 extends Test {
+#if js
+	function test() {
+		var n = cast("5", String); // including this to add the code due to DCE, otherwise remove this if no DCE
+		var fields = [];
+		js.Syntax.code("for (var s in {0}) {1}.push(s)", n, fields);
+		f(fields.contains('__class__'));
+	}
+#end
+}