mirror of
https://github.com/neocities/neocities.git
synced 2025-07-23 19:10:40 +02:00
added monaco code to public js folder and removed cdn
This commit is contained in:
parent
165e17f844
commit
4a7483509e
1387 changed files with 1185013 additions and 24 deletions
37
public/js/monaco/esm/vs/base/common/lazy.js
Normal file
37
public/js/monaco/esm/vs/base/common/lazy.js
Normal file
|
@ -0,0 +1,37 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
export class Lazy {
|
||||
constructor(executor) {
|
||||
this.executor = executor;
|
||||
this._didRun = false;
|
||||
}
|
||||
/**
|
||||
* Get the wrapped value.
|
||||
*
|
||||
* This will force evaluation of the lazy value if it has not been resolved yet. Lazy values are only
|
||||
* resolved once. `getValue` will re-throw exceptions that are hit while resolving the value
|
||||
*/
|
||||
get value() {
|
||||
if (!this._didRun) {
|
||||
try {
|
||||
this._value = this.executor();
|
||||
}
|
||||
catch (err) {
|
||||
this._error = err;
|
||||
}
|
||||
finally {
|
||||
this._didRun = true;
|
||||
}
|
||||
}
|
||||
if (this._error) {
|
||||
throw this._error;
|
||||
}
|
||||
return this._value;
|
||||
}
|
||||
/**
|
||||
* Get the wrapped value without forcing evaluation.
|
||||
*/
|
||||
get rawValue() { return this._value; }
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue