Skip to content

Commit

Permalink
Merge pull request #4831 from andrewnester/bug/4583
Browse files Browse the repository at this point in the history
fix: Uncaught TypeError: Cannot read properties of undefined in worker code
  • Loading branch information
andrewnester authored Jun 29, 2022
2 parents c7b3422 + 3b62a07 commit 6b94371
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/ace/worker/v2/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ define(function (require, exports, module) {
type: "error",
data: {
message: message,
data: err.data,
data: err && err.data,
file: file,
line: line,
col: col,
stack: err.stack
stack: err && err.stack
}
});
};
Expand Down
2 changes: 1 addition & 1 deletion lib/ace/worker/v2/worker_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ define(function (require, exports, module) {

this.$doc = doc;
this.call("setValue", [doc.getValue()]);
doc.on("change", this.changeListener);
doc.on("change", this.changeListener, true);
};

this.changeListener = function (delta) {
Expand Down
4 changes: 2 additions & 2 deletions lib/ace/worker/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ window.ace = window;
window.onerror = function(message, file, line, col, err) {
postMessage({type: "error", data: {
message: message,
data: err.data,
data: err && err.data,
file: file,
line: line,
col: col,
stack: err.stack
stack: err && err.stack
}});
};

Expand Down
2 changes: 1 addition & 1 deletion lib/ace/worker/worker_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ var WorkerClient = function(worker) {

this.$doc = doc;
this.call("setValue", [doc.getValue()]);
doc.on("change", this.changeListener);
doc.on("change", this.changeListener, true);
};

this.changeListener = function(delta) {
Expand Down

0 comments on commit 6b94371

Please sign in to comment.