Complete the following questions so forum users and Wick Editor developers can give you the best help possible! If the following questions are not completed, your post may be edited or removed.
Has this bug been reported already?
Nope
Describe the bug
I have a script that calls a function in it’s parent clip. If that (parent clip) function fails an error occurs and the error message displays the script name an the line number. The editor jumps to that location, but it’s the wrong script. It displays (and jumps to) the calling script but it should have displayed (and jumped to) the called function in the parent clip (the line number is correct for that parent clip.)
To Reproduce
Called function in parent clip:
2:function updater(value){
3://This slider sends a dateTime to the server for history playback
4: let UTCfrom = this.parentClip.fromTimePicker.timeStamp.getTime();
5: let UTCto = this.parentClip.toTimePicker.timeStamp.getTime();
6: let UTCmsecs = UTCfrom+Math.floor((UTCto-UTCfrom)*value);
(Error is in line 4. Excuse the formatting)
The calling script:
if(!isMouseDown()) { this._dragging = false; } if(this._dragging) { if (mouseX!=this.oldMouseX){ this.oldMouseX=mouseX; this.x = mouseX - this._xOffset; //console.log(this.identifier+".x:"+this.x+" ("+mouseX+" - "+this._xOffset+")"); if(this.x < 0) { //-this._bounds this.x = 0;//-this._bounds; } if(this.x > this.parentClip.rail.width) { this.x = this.parentClip.rail.width; } this.parentClip.value = this.x / this.parentClip.rail.width; // console.log("this.value:"+this.parentClip.value+" this.updater:"+this.parentClip.updater); if (this.parentClip.updater) this.parentClip.updater(this.parentClip.value); } }
Error is reported in line 4 of the calling script but is actually in the function called by line 18. Error Message from Chrome console:
index.js:37 Error: Cannot read properties of undefined (reading 'getTime') on line 4 in script "update".
at onError (Editor.jsx:282:27)
at Wick.Project.stop (wickengine.js:51562:47)
at e.componentDidUpdate (Editor.jsx:302:20)
at ls (react-dom.production.min.js:5163:1)
at react-dom.production.min.js:6408:1
at t.unstable_runWithPriority (scheduler.production.min.js:309:1)
at Ui (react-dom.production.min.js:2816:1)
at El (react-dom.production.min.js:6204:1)
at cl (react-dom.production.min.js:5895:1)
at react-dom.production.min.js:2851:1
Expected behavior
The error should have reported (and jumped to) the called parent clip
Screenshots
(don’t know how to add)
*Computer Information
- OS: Windows
- Device Type: Laptop
- Browser Chrome
Please have a look at this and tell me what you think…