删除无用代码

This commit is contained in:
shijian 2023-09-30 05:39:42 +08:00
parent f4043daa54
commit 51bf75c8ba
1 changed files with 1 additions and 4 deletions

View File

@ -7576,7 +7576,7 @@
className+='namespace'; className+='namespace';
} }
}else{ }else{
if(javascriptKeywords.includes(text)||javascriptKeywords.includes(text)){ if(javascriptKeywords.includes(text)){
className+='keyword'; className+='keyword';
} }
else if(window[text]) { else if(window[text]) {
@ -7619,8 +7619,6 @@
const funcProps=Object.getOwnPropertyNames(Array.prototype); const funcProps=Object.getOwnPropertyNames(Array.prototype);
const javascriptKeywords=("break case catch class const continue debugger default delete do else export extends from false finally for function " + const javascriptKeywords=("break case catch class const continue debugger default delete do else export extends from false finally for function " +
"if in import instanceof let new null return super switch this throw true try typeof var void while with yield").split(" "); "if in import instanceof let new null return super switch this throw true try typeof var void while with yield").split(" ");
const coffeescriptKeywords=("and break catch class continue delete do else extends false finally for " +
"if in instanceof isnt new no not null of off on or return switch then throw true try typeof until void while with yes").split(" ");
function getCompletions(token,context,keywords,options){ function getCompletions(token,context,keywords,options){
let found=[],start=token.string,global=options&&options.globalScope||window; let found=[],start=token.string,global=options&&options.globalScope||window;
function maybeAdd(str){ function maybeAdd(str){
@ -7663,7 +7661,6 @@
if(options&&options.additionalContext!=null) for(let key in options.additionalContext) maybeAdd(key); if(options&&options.additionalContext!=null) for(let key in options.additionalContext) maybeAdd(key);
if(!options||options.useGlobalScope!==false) gatherCompletions(global); if(!options||options.useGlobalScope!==false) gatherCompletions(global);
forEach(keywords,maybeAdd); forEach(keywords,maybeAdd);
forEach(coffeescriptKeywords,maybeAdd);
} }
return found.sort((a,b)=>(a+'').localeCompare(b+'')); return found.sort((a,b)=>(a+'').localeCompare(b+''));
} }