diff options
author | 2023-09-18 17:59:09 +0800 | |
---|---|---|
committer | 2023-09-18 02:59:09 -0700 | |
commit | c7de270bbba05e0fc850290b27d617bda1df2206 (patch) | |
tree | 955759fa7a7d4211a11938cec5e8ca7dff65e52c /src/bun.js/bindings/ZigGeneratedClasses+lazyStructureImpl.h | |
parent | c66d4a724b675c6ebbd64ccf98e1ce9933f2ef00 (diff) | |
download | bun-c7de270bbba05e0fc850290b27d617bda1df2206.tar.gz bun-c7de270bbba05e0fc850290b27d617bda1df2206.tar.zst bun-c7de270bbba05e0fc850290b27d617bda1df2206.zip |
feat(test): Implement `arrayContaining` (#5572)
* feat(test): implement `arrayContaining`
* feat: early return when expectedArray is empty
* feat: add test for toEqual
* chore: use `JSC::isArray`
* chore: use getIndex for performance
* fix: use deepEqual
---------
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Diffstat (limited to 'src/bun.js/bindings/ZigGeneratedClasses+lazyStructureImpl.h')
-rw-r--r-- | src/bun.js/bindings/ZigGeneratedClasses+lazyStructureImpl.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/bun.js/bindings/ZigGeneratedClasses+lazyStructureImpl.h b/src/bun.js/bindings/ZigGeneratedClasses+lazyStructureImpl.h index b51752180..84d3df7a0 100644 --- a/src/bun.js/bindings/ZigGeneratedClasses+lazyStructureImpl.h +++ b/src/bun.js/bindings/ZigGeneratedClasses+lazyStructureImpl.h @@ -1,4 +1,4 @@ -void GlobalObject::initGeneratedLazyClasses() { +ALWAYS_INLINE void GlobalObject::initGeneratedLazyClasses() { m_JSAttributeIterator.initLater( [](LazyClassStructure::Initializer& init) { init.setPrototype(WebCore::JSAttributeIterator::createPrototype(init.vm, reinterpret_cast<Zig::GlobalObject*>(init.global))); @@ -107,6 +107,12 @@ void GlobalObject::initGeneratedLazyClasses() { init.setStructure(WebCore::JSExpectAnything::createStructure(init.vm, init.global, init.prototype)); }); + m_JSExpectArrayContaining.initLater( + [](LazyClassStructure::Initializer& init) { + init.setPrototype(WebCore::JSExpectArrayContaining::createPrototype(init.vm, reinterpret_cast<Zig::GlobalObject*>(init.global))); + init.setStructure(WebCore::JSExpectArrayContaining::createStructure(init.vm, init.global, init.prototype)); + + }); m_JSExpectStringContaining.initLater( [](LazyClassStructure::Initializer& init) { init.setPrototype(WebCore::JSExpectStringContaining::createPrototype(init.vm, reinterpret_cast<Zig::GlobalObject*>(init.global))); @@ -321,6 +327,7 @@ void GlobalObject::visitGeneratedLazyClasses(GlobalObject *thisObject, Visitor& thisObject->m_JSExpect.visit(visitor); thisObject->m_JSExpectAny.visit(visitor); thisObject->m_JSExpectAnything.visit(visitor); + thisObject->m_JSExpectArrayContaining.visit(visitor); thisObject->m_JSExpectStringContaining.visit(visitor); thisObject->m_JSExpectStringMatching.visit(visitor); thisObject->m_JSFFI.visit(visitor); |