Skip to content

Commit 4e71cc2

Browse files
committed
Merge pull request scala-js#2138 from sjrd/fix-strong-mode
Fix scala-js#1991: Make the strong mode output pass on Node.js 4.
2 parents dc7c113 + aa833e3 commit 4e71cc2

File tree

8 files changed

+94
-46
lines changed

8 files changed

+94
-46
lines changed

ci/matrix.xml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -108,18 +108,18 @@
108108
<task id="test-suite-ecma-script6"><![CDATA[
109109
setJavaVersion $java
110110
sbtretry 'set Seq(testSuite, noIrCheckTest).map(pr => scalaJSOutputMode in pr := org.scalajs.core.tools.javascript.OutputMode.ECMAScript6)' \
111-
'set Seq(testSuite, noIrCheckTest).map(pr => postLinkJSEnv in pr := NodeJSEnv(executable = "/home/jenkins/apps/iojs-2.0/bin/iojs", args = Seq("--harmony-rest-parameters")).value.withSourceMap(false))' \
111+
'set Seq(testSuite, noIrCheckTest).map(pr => postLinkJSEnv in pr := NodeJSEnv(args = Seq("--harmony-rest-parameters", "--harmony-spreadcalls")).value.withSourceMap(false))' \
112112
'set scalaJSStage in Global := FastOptStage' \
113113
++$scala testSuite/test noIrCheckTest/test \
114114
testSuite/clean noIrCheckTest/clean &&
115115
sbtretry 'set scalaJSOutputMode in testSuite := org.scalajs.core.tools.javascript.OutputMode.ECMAScript6' \
116-
'set postLinkJSEnv in testSuite := NodeJSEnv(executable = "/home/jenkins/apps/iojs-2.0/bin/iojs", args = Seq("--harmony-rest-parameters")).value.withSourceMap(false)' \
116+
'set postLinkJSEnv in testSuite := NodeJSEnv(args = Seq("--harmony-rest-parameters", "--harmony-spreadcalls")).value.withSourceMap(false)' \
117117
'set scalaJSOptimizerOptions in testSuite ~= (_.withDisableOptimizer(true))' \
118118
'set scalaJSStage in Global := FastOptStage' \
119119
++$scala testSuite/test \
120120
testSuite/clean &&
121121
sbtretry 'set scalaJSOutputMode in testSuite := org.scalajs.core.tools.javascript.OutputMode.ECMAScript6' \
122-
'set postLinkJSEnv in testSuite := NodeJSEnv(executable = "/home/jenkins/apps/iojs-2.0/bin/iojs", args = Seq("--harmony-rest-parameters")).value.withSourceMap(false)' \
122+
'set postLinkJSEnv in testSuite := NodeJSEnv(args = Seq("--harmony-rest-parameters", "--harmony-spreadcalls")).value.withSourceMap(false)' \
123123
'set scalaJSSemantics in testSuite ~= {
124124
_.withAsInstanceOfs(org.scalajs.core.tools.sem.CheckedBehavior.Compliant)
125125
.withModuleInit(org.scalajs.core.tools.sem.CheckedBehavior.Compliant)
@@ -129,7 +129,7 @@
129129
++$scala testSuite/test \
130130
testSuite/clean &&
131131
sbtretry 'set scalaJSOutputMode in testSuite := org.scalajs.core.tools.javascript.OutputMode.ECMAScript6' \
132-
'set postLinkJSEnv in testSuite := NodeJSEnv(executable = "/home/jenkins/apps/iojs-2.0/bin/iojs", args = Seq("--harmony-rest-parameters")).value.withSourceMap(false)' \
132+
'set postLinkJSEnv in testSuite := NodeJSEnv(args = Seq("--harmony-rest-parameters", "--harmony-spreadcalls")).value.withSourceMap(false)' \
133133
'set scalaJSSemantics in testSuite ~= {
134134
_.withAsInstanceOfs(org.scalajs.core.tools.sem.CheckedBehavior.Compliant)
135135
.withModuleInit(org.scalajs.core.tools.sem.CheckedBehavior.Compliant)
@@ -140,13 +140,13 @@
140140
++$scala testSuite/test \
141141
testSuite/clean &&
142142
sbtretry 'set scalaJSOutputMode in testSuite := org.scalajs.core.tools.javascript.OutputMode.ECMAScript6' \
143-
'set postLinkJSEnv in testSuite := NodeJSEnv(executable = "/home/jenkins/apps/iojs-2.0/bin/iojs", args = Seq("--harmony-rest-parameters")).value.withSourceMap(false)' \
143+
'set postLinkJSEnv in testSuite := NodeJSEnv(args = Seq("--harmony-rest-parameters", "--harmony-spreadcalls")).value.withSourceMap(false)' \
144144
'set scalaJSSemantics in testSuite ~= { _.optimized }' \
145145
'set scalaJSStage in Global := FastOptStage' \
146146
++$scala testSuite/test \
147147
testSuite/clean &&
148148
sbtretry 'set scalaJSOutputMode in testSuite := org.scalajs.core.tools.javascript.OutputMode.ECMAScript6' \
149-
'set postLinkJSEnv in testSuite := NodeJSEnv(executable = "/home/jenkins/apps/iojs-2.0/bin/iojs", args = Seq("--harmony-rest-parameters")).value.withSourceMap(false)' \
149+
'set postLinkJSEnv in testSuite := NodeJSEnv(args = Seq("--harmony-rest-parameters", "--harmony-spreadcalls")).value.withSourceMap(false)' \
150150
'set scalaJSSemantics in testSuite ~= { _.optimized }' \
151151
'set scalaJSOptimizerOptions in testSuite ~= (_.withDisableOptimizer(true))' \
152152
'set scalaJSStage in Global := FastOptStage' \
@@ -157,18 +157,18 @@
157157
<task id="test-suite-ecma-script6-strong-mode"><![CDATA[
158158
setJavaVersion $java
159159
sbtretry 'set Seq(testSuite, noIrCheckTest).map(pr => scalaJSOutputMode in pr := org.scalajs.core.tools.javascript.OutputMode.ECMAScript6StrongMode)' \
160-
'set Seq(testSuite, noIrCheckTest).map(pr => postLinkJSEnv in pr := NodeJSEnv(executable = "/home/jenkins/apps/iojs-2.0/bin/iojs", args = Seq("--harmony-rest-parameters", "--strong-mode")).value.withSourceMap(false))' \
160+
'set Seq(testSuite, noIrCheckTest).map(pr => postLinkJSEnv in pr := NodeJSEnv(args = Seq("--harmony-rest-parameters", "--harmony-spreadcalls", "--strong-mode")).value.withSourceMap(false))' \
161161
'set scalaJSStage in Global := FastOptStage' \
162162
++$scala testSuite/test noIrCheckTest/test \
163163
testSuite/clean noIrCheckTest/clean &&
164164
sbtretry 'set scalaJSOutputMode in testSuite := org.scalajs.core.tools.javascript.OutputMode.ECMAScript6StrongMode' \
165-
'set postLinkJSEnv in testSuite := NodeJSEnv(executable = "/home/jenkins/apps/iojs-2.0/bin/iojs", args = Seq("--harmony-rest-parameters", "--strong-mode")).value.withSourceMap(false)' \
165+
'set postLinkJSEnv in testSuite := NodeJSEnv(args = Seq("--harmony-rest-parameters", "--harmony-spreadcalls", "--strong-mode")).value.withSourceMap(false)' \
166166
'set scalaJSOptimizerOptions in testSuite ~= (_.withDisableOptimizer(true))' \
167167
'set scalaJSStage in Global := FastOptStage' \
168168
++$scala testSuite/test \
169169
testSuite/clean &&
170170
sbtretry 'set scalaJSOutputMode in testSuite := org.scalajs.core.tools.javascript.OutputMode.ECMAScript6StrongMode' \
171-
'set postLinkJSEnv in testSuite := NodeJSEnv(executable = "/home/jenkins/apps/iojs-2.0/bin/iojs", args = Seq("--harmony-rest-parameters", "--strong-mode")).value.withSourceMap(false)' \
171+
'set postLinkJSEnv in testSuite := NodeJSEnv(args = Seq("--harmony-rest-parameters", "--harmony-spreadcalls", "--strong-mode")).value.withSourceMap(false)' \
172172
'set scalaJSSemantics in testSuite ~= {
173173
_.withAsInstanceOfs(org.scalajs.core.tools.sem.CheckedBehavior.Compliant)
174174
.withModuleInit(org.scalajs.core.tools.sem.CheckedBehavior.Compliant)
@@ -178,7 +178,7 @@
178178
++$scala testSuite/test \
179179
testSuite/clean &&
180180
sbtretry 'set scalaJSOutputMode in testSuite := org.scalajs.core.tools.javascript.OutputMode.ECMAScript6StrongMode' \
181-
'set postLinkJSEnv in testSuite := NodeJSEnv(executable = "/home/jenkins/apps/iojs-2.0/bin/iojs", args = Seq("--harmony-rest-parameters", "--strong-mode")).value.withSourceMap(false)' \
181+
'set postLinkJSEnv in testSuite := NodeJSEnv(args = Seq("--harmony-rest-parameters", "--harmony-spreadcalls", "--strong-mode")).value.withSourceMap(false)' \
182182
'set scalaJSSemantics in testSuite ~= {
183183
_.withAsInstanceOfs(org.scalajs.core.tools.sem.CheckedBehavior.Compliant)
184184
.withModuleInit(org.scalajs.core.tools.sem.CheckedBehavior.Compliant)
@@ -189,13 +189,13 @@
189189
++$scala testSuite/test \
190190
testSuite/clean &&
191191
sbtretry 'set scalaJSOutputMode in testSuite := org.scalajs.core.tools.javascript.OutputMode.ECMAScript6StrongMode' \
192-
'set postLinkJSEnv in testSuite := NodeJSEnv(executable = "/home/jenkins/apps/iojs-2.0/bin/iojs", args = Seq("--harmony-rest-parameters", "--strong-mode")).value.withSourceMap(false)' \
192+
'set postLinkJSEnv in testSuite := NodeJSEnv(args = Seq("--harmony-rest-parameters", "--harmony-spreadcalls", "--strong-mode")).value.withSourceMap(false)' \
193193
'set scalaJSSemantics in testSuite ~= { _.optimized }' \
194194
'set scalaJSStage in Global := FastOptStage' \
195195
++$scala testSuite/test \
196196
testSuite/clean &&
197197
sbtretry 'set scalaJSOutputMode in testSuite := org.scalajs.core.tools.javascript.OutputMode.ECMAScript6StrongMode' \
198-
'set postLinkJSEnv in testSuite := NodeJSEnv(executable = "/home/jenkins/apps/iojs-2.0/bin/iojs", args = Seq("--harmony-rest-parameters", "--strong-mode")).value.withSourceMap(false)' \
198+
'set postLinkJSEnv in testSuite := NodeJSEnv(args = Seq("--harmony-rest-parameters", "--harmony-spreadcalls", "--strong-mode")).value.withSourceMap(false)' \
199199
'set scalaJSSemantics in testSuite ~= { _.optimized }' \
200200
'set scalaJSOptimizerOptions in testSuite ~= (_.withDisableOptimizer(true))' \
201201
'set scalaJSStage in Global := FastOptStage' \

javalib/src/main/scala/java/math/BigDecimal.scala

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ object BigDecimal {
112112

113113
private def addAndMult10(thisValue: BigDecimal, augend: BigDecimal,
114114
diffScale: Int): BigDecimal = {
115-
val powLen = LongTenPowsBitLength(diffScale)
116-
val augPlusPowLength = augend._bitLength + powLen
117-
val maxLen = Math.max(thisValue._bitLength, augPlusPowLength) + 1
115+
def powLen = LongTenPowsBitLength(diffScale)
116+
def augPlusPowLength = augend._bitLength + powLen
117+
def maxLen = Math.max(thisValue._bitLength, augPlusPowLength) + 1
118118

119119
if (diffScale < LongTenPows.length && maxLen < 64) {
120120
val augPlusPowLength = augend._smallValue * LongTenPows(diffScale)
@@ -494,7 +494,7 @@ class BigDecimal() extends Number with Comparable[BigDecimal] {
494494
_intVal = new BigInteger(1, mantissa3).shiftLeft(-_scale)
495495
_scale = 0
496496
} else if (_scale > 0) {
497-
val mSum = mantissaBits + LongFivePowsBitLength(_scale)
497+
def mSum = mantissaBits + LongFivePowsBitLength(_scale)
498498
if (_scale < LongFivePows.length && mSum < 64) {
499499
_smallValue = mantissa3 * LongFivePows(_scale)
500500
_bitLength = bitLength(_smallValue)
@@ -619,8 +619,8 @@ class BigDecimal() extends Number with Comparable[BigDecimal] {
619619
else
620620
new BigDecimal(getUnscaledValue.subtract(subtrahend.getUnscaledValue), _scale)
621621
} else if (diffScale > 0) {
622-
val powTenLen = LongTenPowsBitLength(diffScale)
623-
val maxLen = Math.max(this._bitLength, subtrahend._bitLength + powTenLen) + 1
622+
def powTenLen = LongTenPowsBitLength(diffScale)
623+
def maxLen = Math.max(this._bitLength, subtrahend._bitLength + powTenLen) + 1
624624

625625
if (diffScale < LongTenPows.length && maxLen < 64) {
626626
val powTen = LongTenPows(diffScale)
@@ -631,8 +631,8 @@ class BigDecimal() extends Number with Comparable[BigDecimal] {
631631
}
632632
} else {
633633
val negDiffScale = -diffScale
634-
val powTenLen = LongTenPowsBitLength(negDiffScale)
635-
val maxLen = Math.max(this._bitLength + powTenLen, subtrahend._bitLength) + 1
634+
def powTenLen = LongTenPowsBitLength(negDiffScale)
635+
def maxLen = Math.max(this._bitLength + powTenLen, subtrahend._bitLength) + 1
636636

637637
if (negDiffScale < LongTenPows.length && maxLen < 64) {
638638
val powTen = LongTenPows(negDiffScale)
@@ -1134,7 +1134,7 @@ class BigDecimal() extends Number with Comparable[BigDecimal] {
11341134
if (diffScale == 0) {
11351135
this
11361136
} else if (diffScale > 0) {
1137-
val cmp = this._bitLength + LongTenPowsBitLength(diffScale.toInt)
1137+
def cmp = this._bitLength + LongTenPowsBitLength(diffScale.toInt)
11381138
if (diffScale < LongTenPows.length && cmp < 64) {
11391139
valueOf(this._smallValue * LongTenPows(diffScale.toInt), newScale)
11401140
} else {
@@ -1654,7 +1654,7 @@ class BigDecimal() extends Number with Comparable[BigDecimal] {
16541654
private def isZero(): Boolean = _bitLength == 0 && this._smallValue != -1
16551655

16561656
private def movePoint(newScale: Long): BigDecimal = {
1657-
val lptbLen = LongTenPowsBitLength(-newScale.toInt)
1657+
def lptbLen = LongTenPowsBitLength(-newScale.toInt)
16581658

16591659
if (isZero) {
16601660
zeroScaledBy(Math.max(newScale, 0))

project/Build.scala

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1212,6 +1212,26 @@ object Build extends sbt.Build {
12121212
Seq(outFile)
12131213
},
12141214

1215+
// #2137: Scala.js-defined JS classes are broken in strong mode
1216+
sources in Test := {
1217+
import org.scalajs.core.tools.javascript.OutputMode
1218+
val original = (sources in Test).value
1219+
val mode = (scalaJSOutputMode in Test).value
1220+
if (mode != OutputMode.ECMAScript6StrongMode) {
1221+
original
1222+
} else {
1223+
original.filter { f =>
1224+
val path = f.getPath.replace('\\', '/')
1225+
val exclude = {
1226+
path.endsWith("/org/scalajs/testsuite/jsinterop/ExportsTest.scala") ||
1227+
path.endsWith("/org/scalajs/testsuite/jsinterop/MiscInteropTest.scala") ||
1228+
path.endsWith("/org/scalajs/testsuite/jsinterop/ScalaJSDefinedTest.scala")
1229+
}
1230+
!exclude
1231+
}
1232+
}
1233+
},
1234+
12151235
scalacOptions in Test ++= {
12161236
if (isGeneratingEclipse) {
12171237
Seq.empty

test-suite/js/src/test/scala/org/scalajs/testsuite/jsinterop/ScalaJSDefinedTest.scala

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -761,8 +761,6 @@ object ScalaJSDefinedTest extends JasmineTest {
761761
expect(dyn.dependent(8)).toEqual(-1)
762762
}
763763

764-
/* TODO This is disabled because the ECMAScript 6 output cannot be parsed
765-
* by io.js at the moment.
766764
it("call super constructor with : _*") {
767765
@ScalaJSDefined
768766
class CallSuperCtorWithSpread(x: Int, y: Int, z: Int)
@@ -776,7 +774,6 @@ object ScalaJSDefinedTest extends JasmineTest {
776774
expect(dyn.x).toEqual(4)
777775
expect(dyn.args).toEqual(js.Array(8, 23))
778776
}
779-
*/
780777

781778
it("override native method") {
782779
@ScalaJSDefined

test-suite/js/src/test/scala/org/scalajs/testsuite/utils/TestDetector.scala

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,11 @@ object TestDetector {
3232
/* We make sure to use only select exported modules (not classes) by
3333
* checking .prototype of the exporters.
3434
*/
35-
(js.typeOf(item) == "function") &&
36-
(js.Object.getPrototypeOf(item.prototype.asInstanceOf[js.Object]) eq
37-
js.Object.asInstanceOf[js.Dynamic].prototype)
35+
(js.typeOf(item) == "function") && {
36+
js.isUndefined(item.prototype) || // happens for static methods
37+
(js.Object.getPrototypeOf(item.prototype.asInstanceOf[js.Object]) eq
38+
js.Object.asInstanceOf[js.Dynamic].prototype)
39+
}
3840
}
3941

4042
def rec(item: js.Dynamic, fullName: String): List[(js.Dynamic, String)] = {

tools/shared/src/main/scala/org/scalajs/core/tools/javascript/JSDesugaring.scala

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1721,8 +1721,12 @@ private[javascript] object JSDesugaring {
17211721
case Long_> => genLongMethodApply(newLhs, LongImpl.>, newRhs)
17221722
case Long_>= => genLongMethodApply(newLhs, LongImpl.>=, newRhs)
17231723

1724-
case Boolean_| => !(!js.BinaryOp(JSBinaryOp.|, newLhs, newRhs))
1725-
case Boolean_& => !(!js.BinaryOp(JSBinaryOp.&, newLhs, newRhs))
1724+
case Boolean_| =>
1725+
if (isStrongMode) genCallHelper("boolOr", newLhs, newRhs)
1726+
else !(!js.BinaryOp(JSBinaryOp.|, newLhs, newRhs))
1727+
case Boolean_& =>
1728+
if (isStrongMode) genCallHelper("boolAnd", newLhs, newRhs)
1729+
else !(!js.BinaryOp(JSBinaryOp.&, newLhs, newRhs))
17261730
}
17271731

17281732
case NewArray(tpe, lengths) =>

tools/shared/src/main/scala/org/scalajs/core/tools/javascript/ScalaJSClassEmitter.scala

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -507,8 +507,11 @@ final class ScalaJSClassEmitter private (
507507
js.BooleanLiteral(false)
508508

509509
case _ =>
510-
var test = (genIsScalaJSObject(obj) &&
511-
(obj DOT "$classData" DOT "ancestors" DOT className))
510+
var test = {
511+
genIsScalaJSObject(obj) &&
512+
genIsClassNameInAncestors(className,
513+
obj DOT "$classData" DOT "ancestors")
514+
}
512515

513516
if (isAncestorOfString)
514517
test = test || (
@@ -605,9 +608,12 @@ final class ScalaJSClassEmitter private (
605608
}))
606609

607610
case _ =>
608-
js.Return(!(!(genIsScalaJSObject(obj) &&
609-
((obj DOT "$classData" DOT "arrayDepth") === depth) &&
610-
(obj DOT "$classData" DOT "arrayBase" DOT "ancestors" DOT className))))
611+
js.Return(!(!({
612+
genIsScalaJSObject(obj) &&
613+
((obj DOT "$classData" DOT "arrayDepth") === depth) &&
614+
genIsClassNameInAncestors(className,
615+
obj DOT "$classData" DOT "arrayBase" DOT "ancestors")
616+
})))
611617
}))
612618
}
613619

@@ -639,6 +645,15 @@ final class ScalaJSClassEmitter private (
639645
}
640646
}
641647

648+
private def genIsClassNameInAncestors(className: String, ancestors: js.Tree)(
649+
implicit pos: Position): js.Tree = {
650+
import TreeDSL._
651+
if (outputMode != OutputMode.ECMAScript6StrongMode)
652+
ancestors DOT className
653+
else
654+
js.BinaryOp(JSBinaryOp.in, js.StringLiteral(className), ancestors)
655+
}
656+
642657
def genTypeData(tree: LinkedClass): js.Tree = {
643658
import Definitions._
644659
import TreeDSL._

tools/strongmodeenv.js

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ const $env = (typeof __ScalaJSEnv === "object" && __ScalaJSEnv) ? __ScalaJSEnv :
33

44
// Global scope
55
const $g =
6-
(typeof $env["global"] === "object" && $env["global"])
6+
(typeof $jsSelect($env, "global") === "object" && $env["global"])
77
? $env["global"]
8-
: ((typeof __global === "object" && __global && __global["Object"] === Object) ? __global : __this);
9-
$env["global"] = $g;
8+
: ((typeof __global === "object" && __global && $jsSelect(__global, "Object") === Object) ? __global : __this);
9+
$jsAssign($env, "global", $g);
1010

1111
// Where to send exports
1212
const $e =
13-
(typeof $env["exportsNamespace"] === "object" && $env["exportsNamespace"])
13+
(typeof $jsSelect($env, "exportsNamespace") === "object" && $env["exportsNamespace"])
1414
? $env["exportsNamespace"] : $g;
15-
$env["exportsNamespace"] = $e;
15+
$jsAssign($env, "exportsNamespace", $e);
1616

1717
// Freeze the environment info
1818
$g["Object"]["freeze"]($env);
@@ -141,6 +141,16 @@ function $toString(x) {
141141
return `${x}`;
142142
}
143143

144+
/** Non-short-circuit boolean | */
145+
function $boolOr(a, b) {
146+
return a || b;
147+
}
148+
149+
/** Non-short-circuit boolean & */
150+
function $boolAnd(a, b) {
151+
return a && b;
152+
}
153+
144154
// Declaration of type data
145155

146156
let $d_V = null;
@@ -394,11 +404,11 @@ class $ {
394404
static throwClassCastException(instance, classFullName) {
395405
//!if asInstanceOfs == Compliant
396406
throw new $c_jl_ClassCastException().init___T(
397-
instance + " is not an instance of " + classFullName);
407+
`${instance} is not an instance of ${classFullName}`);
398408
//!else
399409
throw new $c_sjsr_UndefinedBehaviorError().init___jl_Throwable(
400410
new $c_jl_ClassCastException().init___T(
401-
instance + " is not an instance of " + classFullName));
411+
`${instance} is not an instance of ${classFullName}`));
402412
//!endif
403413
};
404414

@@ -562,7 +572,7 @@ class $ {
562572
//!if asInstanceOfs != Unchecked
563573
$asBoolean(rhs);
564574
//!endif
565-
return instance - rhs; // yes, this gives the right result
575+
return (instance === rhs) ? 0 : (instance ? 1 : -1);
566576
default:
567577
return instance.compareTo__O__I(rhs);
568578
}
@@ -758,12 +768,12 @@ class $TypeData {
758768
const internalName = $propertyName(internalNameObj);
759769

760770
isInstance = isInstance || function(obj) {
761-
return !!(obj && obj.$classData && obj.$classData.ancestors[internalName]);
771+
return $isScalaJSObject(obj) && (internalName in obj.$classData.ancestors);
762772
};
763773

764774
isArrayOf = isArrayOf || function(obj, depth) {
765-
return !!(obj && obj.$classData && (obj.$classData.arrayDepth === depth)
766-
&& obj.$classData.arrayBase.ancestors[internalName])
775+
return ($isScalaJSObject(obj) && (obj.$classData.arrayDepth === depth)
776+
&& internalName in obj.$classData.arrayBase.ancestors);
767777
};
768778

769779
// Runtime support

0 commit comments

Comments
 (0)