From cc688f7367d15935a442415c67e5a56a1c346356 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Wed, 3 Nov 2021 03:08:08 -0400 Subject: [PATCH] ace: Delete dead code --- doc/api/editorInfo.md | 3 --- src/static/js/ace.js | 6 ------ src/static/js/ace2_inner.js | 28 ---------------------------- 3 files changed, 37 deletions(-) diff --git a/doc/api/editorInfo.md b/doc/api/editorInfo.md index 5a8551eba..834f5ac3c 100644 --- a/doc/api/editorInfo.md +++ b/doc/api/editorInfo.md @@ -29,9 +29,6 @@ Returns the `rep` object. ## editorInfo.ace_applyPreparedChangesetToBase() ## editorInfo.ace_setUserChangeNotificationCallback(f) ## editorInfo.ace_setAuthorInfo(author, info) -## editorInfo.ace_setAuthorSelectionRange(author, start, end) -## editorInfo.ace_getUnhandledErrors() -## editorInfo.ace_getDebugProperty(prop) ## editorInfo.ace_fastIncorp(?) ## editorInfo.ace_isCaret(?) ## editorInfo.ace_getLineAndCharForPoint(?) diff --git a/src/static/js/ace.js b/src/static/js/ace.js index efb38077f..b0a042570 100644 --- a/src/static/js/ace.js +++ b/src/static/js/ace.js @@ -120,7 +120,6 @@ const Ace2Editor = function () { 'applyPreparedChangesetToBase', 'setUserChangeNotificationCallback', 'setAuthorInfo', - 'setAuthorSelectionRange', 'callWithAce', 'execCommand', 'replaceRange', @@ -137,8 +136,6 @@ const Ace2Editor = function () { this.exportText = () => loaded ? info.ace_exportText() : '(awaiting init)\n'; - this.getDebugProperty = (prop) => info.ace_getDebugProperty(prop); - this.getInInternationalComposition = () => loaded ? info.ace_getInInternationalComposition() : null; @@ -152,9 +149,6 @@ const Ace2Editor = function () { // changes, and modify the changeset to be applied by applyPreparedChangesetToBase accordingly. this.prepareUserChangeset = () => loaded ? info.ace_prepareUserChangeset() : null; - // returns array of {error: , time: +new Date()} - this.getUnhandledErrors = () => loaded ? info.ace_getUnhandledErrors() : []; - const addStyleTagsFor = (doc, files) => { for (const file of files) { const link = doc.createElement('link'); diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js index 4672751dc..675427019 100644 --- a/src/static/js/ace2_inner.js +++ b/src/static/js/ace2_inner.js @@ -50,8 +50,6 @@ function Ace2Inner(editorInfo, cssManagers) { const FORMATTING_STYLES = ['bold', 'italic', 'underline', 'strikethrough']; const SELECT_BUTTON_CLASS = 'selected'; - const caughtErrors = []; - let thisAuthor = ''; let disposed = false; @@ -375,13 +373,6 @@ function Ace2Inner(editorInfo, cssManagers) { }); cleanExit = true; - } catch (e) { - caughtErrors.push( - { - error: e, - time: +new Date(), - }); - throw e; } finally { const cs = currentCallStack; if (cleanExit) { @@ -695,28 +686,9 @@ function Ace2Inner(editorInfo, cssManagers) { editorInfo.ace_setAuthorInfo = (author, info) => { setAuthorInfo(author, info); }; - editorInfo.ace_setAuthorSelectionRange = (author, start, end) => { - changesetTracker.setAuthorSelectionRange(author, start, end); - }; - - editorInfo.ace_getUnhandledErrors = () => caughtErrors.slice(); editorInfo.ace_getDocument = () => document; - editorInfo.ace_getDebugProperty = (prop) => { - if (prop === 'debugger') { - // obfuscate "eval" so as not to scare yuicompressor - window['ev' + 'al']('debugger'); - } else if (prop === 'rep') { - return rep; - } else if (prop === 'window') { - return window; - } else if (prop === 'document') { - return document; - } - return undefined; - }; - const now = () => Date.now(); const newTimeLimit = (ms) => {