diff options
author | 2023-05-24 19:37:57 -0700 | |
---|---|---|
committer | 2023-05-24 19:37:57 -0700 | |
commit | 88d9bac5ec4f6a075724bd4601079b404da9f991 (patch) | |
tree | 43eb94f26446735a94c6778ba955e51cb088c2ec /src/bun.js/bindings/ScriptExecutionContext.cpp | |
parent | 63740a382bbf65fc20fb9c1f1211fbc9285bd9e5 (diff) | |
download | bun-88d9bac5ec4f6a075724bd4601079b404da9f991.tar.gz bun-88d9bac5ec4f6a075724bd4601079b404da9f991.tar.zst bun-88d9bac5ec4f6a075724bd4601079b404da9f991.zip |
Support `with { type: "macro"}` in `bun build` (#3059)
* [bun macro] Support `assert { type: "macro" }` and `with {type: "macro"}`
* [bun macro] Pass through input as arguments instead of a JSNode
* Fix hang when loading many entry points simultaneously with macros
* do not clone
---------
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Diffstat (limited to 'src/bun.js/bindings/ScriptExecutionContext.cpp')
-rw-r--r-- | src/bun.js/bindings/ScriptExecutionContext.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/bun.js/bindings/ScriptExecutionContext.cpp b/src/bun.js/bindings/ScriptExecutionContext.cpp index 08e8e11ef..e8cae5e33 100644 --- a/src/bun.js/bindings/ScriptExecutionContext.cpp +++ b/src/bun.js/bindings/ScriptExecutionContext.cpp @@ -10,7 +10,7 @@ extern "C" void Bun__startLoop(us_loop_t* loop); namespace WebCore { -static unsigned lastUniqueIdentifier = 0; +static std::atomic<unsigned> lastUniqueIdentifier = 0; static Lock allScriptExecutionContextsMapLock; static HashMap<ScriptExecutionContextIdentifier, ScriptExecutionContext*>& allScriptExecutionContextsMap() WTF_REQUIRES_LOCK(allScriptExecutionContextsMapLock) @@ -41,7 +41,7 @@ us_socket_context_t* ScriptExecutionContext::webSocketContextSSL() us_bun_socket_context_options_t opts; memset(&opts, 0, sizeof(us_bun_socket_context_options_t)); // adds root ca - opts.request_cert = true; + opts.request_cert = true; // but do not reject unauthorized opts.reject_unauthorized = false; this->m_ssl_client_websockets_ctx = us_create_bun_socket_context(1, loop, sizeof(size_t), opts); @@ -108,12 +108,12 @@ void ScriptExecutionContext::regenerateIdentifier() { Locker locker { allScriptExecutionContextsMapLock }; - ASSERT(allScriptExecutionContextsMap().contains(m_identifier)); - allScriptExecutionContextsMap().remove(m_identifier); + // ASSERT(allScriptExecutionContextsMap().contains(m_identifier)); + // allScriptExecutionContextsMap().remove(m_identifier); m_identifier = ++lastUniqueIdentifier; - ASSERT(!allScriptExecutionContextsMap().contains(m_identifier)); + // ASSERT(!allScriptExecutionContextsMap().contains(m_identifier)); allScriptExecutionContextsMap().add(m_identifier, this); } @@ -121,14 +121,14 @@ void ScriptExecutionContext::addToContextsMap() { Locker locker { allScriptExecutionContextsMapLock }; ASSERT(!allScriptExecutionContextsMap().contains(m_identifier)); - allScriptExecutionContextsMap().add(m_identifier, this); + // allScriptExecutionContextsMap().add(m_identifier, this); } void ScriptExecutionContext::removeFromContextsMap() { Locker locker { allScriptExecutionContextsMapLock }; ASSERT(allScriptExecutionContextsMap().contains(m_identifier)); - allScriptExecutionContextsMap().remove(m_identifier); + // allScriptExecutionContextsMap().remove(m_identifier); } } |