Code Editor: Remove keeping track of wp.codeEditor instances since unused and no removal of instances upon deletion, leading to memory leak.
See #12423. Built from https://develop.svn.wordpress.org/trunk@41852 git-svn-id: http://core.svn.wordpress.org/trunk@41686 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -25,14 +25,6 @@ if ( 'undefined' === typeof window.wp.codeEditor ) {
|
||||
onUpdateErrorNotice: function() {}
|
||||
};
|
||||
|
||||
/**
|
||||
* All instances of code editors.
|
||||
*
|
||||
* @since 4.9.0
|
||||
* @type {Array.<CodeEditorInstance>}
|
||||
*/
|
||||
wp.codeEditor.instances = [];
|
||||
|
||||
/**
|
||||
* Configure linting.
|
||||
*
|
||||
@@ -252,9 +244,6 @@ if ( 'undefined' === typeof window.wp.codeEditor ) {
|
||||
codemirror: codemirror
|
||||
};
|
||||
|
||||
// Keep track of the instances that have been created.
|
||||
wp.codeEditor.instances.push( instance );
|
||||
|
||||
if ( codemirror.showHint ) {
|
||||
codemirror.on( 'keyup', function( editor, event ) { // eslint-disable-line complexity
|
||||
var shouldAutocomplete, isAlphaKey = /^[a-zA-Z]$/.test( event.key ), lineBeforeCursor, innerMode, token;
|
||||
|
||||
Reference in New Issue
Block a user