Arlolra has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/259626

Change subject: Don't use code set on domino errors as http status code
......................................................................

Don't use code set on domino errors as http status code

 * This fix is dumb; don't merge.  We probably shouldn't just blindly be
   using e.code as the http status code.  In the cases where we actually
   want this, we should be more explicit about it, since this'll
   probably come up again if we don't future proof it.  e.code seems
   pretty generic.

Bug: T121611
Change-Id: I60364ebee02d954721110eeec16e0ae80061a938
---
M lib/wt2html/HTML5TreeBuilder.js
A t
2 files changed, 12 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid 
refs/changes/26/259626/1

diff --git a/lib/wt2html/HTML5TreeBuilder.js b/lib/wt2html/HTML5TreeBuilder.js
index 9b0ca3d..04b47e7 100644
--- a/lib/wt2html/HTML5TreeBuilder.js
+++ b/lib/wt2html/HTML5TreeBuilder.js
@@ -99,6 +99,17 @@
        this.processToken(new TagTk('body'));
 };
 
+TreeBuilder.prototype.emit = function() {
+       var args = Array.from(arguments);
+       try {
+               events.EventEmitter.prototype.emit.apply(this, args);
+       } catch (e) {
+               // Remove any code set by domino and rethrow.
+               e.code = undefined;
+               throw e;
+       }
+};
+
 TreeBuilder.prototype.onChunk = function(tokens) {
        var n = tokens.length;
        for (var i = 0; i < n; i++) {
diff --git a/t b/t
new file mode 100644
index 0000000..dd5ba97
--- /dev/null
+++ b/t
@@ -0,0 +1 @@
+<table data-sort-a+b="123"><td>haha</td></table>

-- 
To view, visit https://gerrit.wikimedia.org/r/259626
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I60364ebee02d954721110eeec16e0ae80061a938
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Arlolra <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to