You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
vm: instanceof test fails when assigning global to vm context #7351
Activity
cjihrig commentedon Jun 21, 2016
Seems like expected behavior to me.
Arrayreferences a different thing in each context.targos commentedon Jun 21, 2016
Yes, that is expected behavior. You can work around this problem for arrays with
Array.isArraythat works across contexts.Replace a.constructor === Array with Array.isArray(a)
fix(helper.isArray): replace a.constructor === Array with Array.isArray
rubenstolk commentedon Jun 21, 2018
A helpful workaround is to use a custom
isInstanceOfutility method, e.g.:fix(helper.isArray): replace a.constructor === Array with Array.isArray
fix(helper.isArray): replace a.constructor === Array with Array.isArray