This is an automated email from the ASF dual-hosted git repository.

gregdove pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/develop by this push:
     new 0cf5dad  Make the IBead debug-only check more helpful here (the error 
message alone does not provide a good clue because of stringification)
0cf5dad is described below

commit 0cf5dada64b073f4f2b4004d9670f43b673c9659
Author: greg-dove <[email protected]>
AuthorDate: Fri Aug 13 10:27:33 2021 +1200

    Make the IBead debug-only check more helpful here (the error message alone 
does not provide a good clue because of stringification)
---
 .../Core/src/main/royale/org/apache/royale/core/ElementWrapper.as   | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git 
a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/ElementWrapper.as
 
b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/ElementWrapper.as
index 3bb85db..2386007 100644
--- 
a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/ElementWrapper.as
+++ 
b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/ElementWrapper.as
@@ -265,7 +265,11 @@ package org.apache.royale.core
                        {
                                _beads = new Vector.<IBead>();
                        }
-            if (goog.DEBUG && !(bead is IBead)) throw new TypeError('Cannot 
convert '+bead+' to IBead');
+            if (goog.DEBUG && !(bead is IBead)) {
+                //console output is more descriptive than the error because 
the error message stringification only has [object Object]:
+                console.log('Cannot convert ',bead,' to IBead');
+                throw new TypeError('Cannot convert '+bead+' to IBead');
+            }
                        _beads.push(bead);
                        bead.strand = this;
                }

Reply via email to