Skip to content

Commit 29ac39c

Browse files
mstoykovclaude
andauthored
Update sobek and regexp2 (#6218)
sobek: 267a0e055bb4 -> 7781506a890f regexp2/v2: v2.2.2 -> v2.5.2 (indirect) sobek: - WeakMap/WeakSet entries are now actually collectable. Instead of storing values in a map hanging off each key *Object (which kept them alive as long as the key was reachable), weak maps hold their own mutex-guarded map keyed by object identity and use runtime.AddCleanup to drop entries when the key is collected. - Object and Symbol shrank: both derive identity from their own address, so Object.id, Object.weakRefs, Symbol.h and Runtime.genId are gone. - String.prototype.split no longer round-trips through UTF-8, with dedicated ASCII and UTF-16 paths; indexOf/lastIndexOf on unicode strings use bytes.Index/LastIndex above a 32-unit crossover instead of a naive scan. CompareTo compares UTF-16 code units, fixing ordering around surrogates. - Several typed array fixes: filter, toSorted and with ignored the view's offset when writing to the destination; slice mishandled forward-overlapping buffers; with validated the index before coercing its argument, so a detaching valueOf was missed; out-of-bounds foreign sets no longer fall through to the generic path. - baseObject.setForeignIdx passed its arguments in the wrong order, sending the property name as the value. regexp2: - Backtracking is now bounded. MaxBacktrackingStackSize (default 100000, negative to disable) and OptionMaxBacktrackingStackSize cap the track stack, and a match that exceeds it fails with ErrBacktrackingStackLimit rather than growing until it runs out of memory. This complements MatchTimeout for catastrophic patterns. - Bool-only matching APIs run a second compiled program with capture marks removed for slots the pattern never observes. - The "advance past an empty match" logic moved into scan(), replacing four copies in FindNextMatch, findAllRunesIndex and both replace runners, and keeps Runtextstart put so \G behaves. - Leading single-set patterns get a prefix-scan fast path, and alternations precompute their distinct first runes. - Fixes a CharSet aliased and mutated during fixed-set analysis, and collapses a repeat of an empty expression that otherwise cost a backtracking frame per iteration. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent cca3e52 commit 29ac39c

27 files changed

Lines changed: 888 additions & 410 deletions

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ require (
2222
github.com/gorilla/websocket v1.5.3
2323
github.com/grafana/k6-cloud-openapi-client-go v0.0.3-0.20260716125012-97c96146fa7c
2424
github.com/grafana/k6provider v0.5.0
25-
github.com/grafana/sobek v0.0.0-20260708062710-267a0e055bb4
25+
github.com/grafana/sobek v0.0.0-20260727154728-7781506a890f
2626
github.com/grafana/sobek-webapi-encoding v0.1.0
2727
github.com/grafana/xk6-dashboard-assets v0.1.2
2828
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0
@@ -77,7 +77,7 @@ require (
7777
github.com/cespare/xxhash/v2 v2.3.0 // indirect
7878
github.com/chromedp/sysutil v1.1.0 // indirect
7979
github.com/davecgh/go-spew v1.1.1 // indirect
80-
github.com/dlclark/regexp2/v2 v2.2.2 // indirect
80+
github.com/dlclark/regexp2/v2 v2.5.2 // indirect
8181
github.com/go-logr/logr v1.4.3 // indirect
8282
github.com/go-logr/stdr v1.2.2 // indirect
8383
github.com/google/pprof v0.0.0-20260115054156-294ebfa9ad83 // indirect

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46t
3636
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
3737
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
3838
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
39-
github.com/dlclark/regexp2/v2 v2.2.2 h1:MYWvNYw8okuqNhwTYO587EZMiDruVa2vhV6fsGpfya0=
40-
github.com/dlclark/regexp2/v2 v2.2.2/go.mod h1:avUrQvPaLz2DrFNHJF0taWAFFX2C1GMSSoeiqFjcBmU=
39+
github.com/dlclark/regexp2/v2 v2.5.2 h1:HAsucWRhsqcDzl6Ua9aR8JwYOTzrZyPrF0/FNxJVAI0=
40+
github.com/dlclark/regexp2/v2 v2.5.2/go.mod h1:avUrQvPaLz2DrFNHJF0taWAFFX2C1GMSSoeiqFjcBmU=
4141
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
4242
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
4343
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
@@ -96,8 +96,8 @@ github.com/grafana/k6-cloud-openapi-client-go v0.0.3-0.20260716125012-97c96146fa
9696
github.com/grafana/k6-cloud-openapi-client-go v0.0.3-0.20260716125012-97c96146fa7c/go.mod h1:RhZGBq6e90zSi0EME83c6S1qkOzD8pP0MNETqieWX0k=
9797
github.com/grafana/k6provider v0.5.0 h1:SwItWPOMQHfRytezQBKpeXLxjNmcyD/x9PTA28pEbwg=
9898
github.com/grafana/k6provider v0.5.0/go.mod h1:R9WKthnwk96E47m6w/mnC13hhBYTn5iMdP5caFt/t5k=
99-
github.com/grafana/sobek v0.0.0-20260708062710-267a0e055bb4 h1:LJ2pEOxFbfUIhrkpROwZ6hLhuCn6e5GSX08v5GFwN/4=
100-
github.com/grafana/sobek v0.0.0-20260708062710-267a0e055bb4/go.mod h1:BL/2XROA/Wtlb+zGEhkSdSZiMFIgw+D2ZdDfrbccyVE=
99+
github.com/grafana/sobek v0.0.0-20260727154728-7781506a890f h1:YNPYRCa0yVIPtLYrzNzsfObrRZJQDupuGL3zW3SWn0M=
100+
github.com/grafana/sobek v0.0.0-20260727154728-7781506a890f/go.mod h1:Sza3zAy+gfXCTtzbPuijuT5odA6N3lQxMTVpCP8sC/4=
101101
github.com/grafana/sobek-webapi-encoding v0.1.0 h1:2qf2pUiI6j33vl2etSE0Id4mfSQ4Jfa0VVfUuSccAkI=
102102
github.com/grafana/sobek-webapi-encoding v0.1.0/go.mod h1:IegnWm83cyZ8qTnfL6Rivmx7dpMVE+w3CblopwfL/go=
103103
github.com/grafana/xk6-dashboard-assets v0.1.2 h1:n2wqytPICn2ZYsKa9HE6GlvFXk+WjByMfT4eM+ms3gE=

internal/js/tc39/breaking_test_errors-stripTypes=false.json

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -221,16 +221,6 @@
221221
"test/built-ins/RegExp/unicode_restricted_incomplete_quantifier.js-strict:true": "test/built-ins/RegExp/unicode_restricted_incomplete_quantifier.js: Test262Error: RegExp(\"a{\", \"u\"): Expected a SyntaxError to be thrown but no exception was thrown at all <at omitted>",
222222
"test/built-ins/RegExp/unicode_restricted_octal_escape.js-strict:true": "test/built-ins/RegExp/unicode_restricted_octal_escape.js: Test262Error: RegExp(\"\\1\", \"u\"): Expected a SyntaxError to be thrown but no exception was thrown at all <at omitted>",
223223
"test/built-ins/RegExp/unicode_restricted_quantifiable_assertion.js-strict:true": "test/built-ins/RegExp/unicode_restricted_quantifiable_assertion.js: Test262Error: RegExp(\"(?=.)*\", \"u\"): Expected a SyntaxError to be thrown but no exception was thrown at all <at omitted>",
224-
"test/built-ins/TypedArray/prototype/slice/speciesctor-return-same-buffer-with-offset.js-strict:true": "test/built-ins/TypedArray/prototype/slice/speciesctor-return-same-buffer-with-offset.js: Test262Error: Actual [8.1254e-320, 40.0000000001169, 50, 60] and expected [20, 20, 20, 60] should have the same contents. (Testing with Float64Array and makePassthrough.) <at omitted>",
225-
"test/built-ins/TypedArray/prototype/with/value-throw-completion.js-strict:true": "test/built-ins/TypedArray/prototype/with/value-throw-completion.js: Test262Error: Positive too large index Expected a MyError but got a RangeError (Testing with Float64Array and makePassthrough.) <at omitted>",
226-
"test/built-ins/TypedArrayConstructors/internals/Set/BigInt/key-is-canonical-invalid-index-prototype-chain-set.js-strict:true": "test/built-ins/TypedArrayConstructors/internals/Set/BigInt/key-is-canonical-invalid-index-prototype-chain-set.js: Test262Error: 1 setter should be unreachable! (Testing with BigInt64Array and makePassthrough.) <at omitted>",
227-
"test/built-ins/TypedArrayConstructors/internals/Set/BigInt/key-is-canonical-invalid-index-reflect-set.js-strict:true": "test/built-ins/TypedArrayConstructors/internals/Set/BigInt/key-is-canonical-invalid-index-reflect-set.js: Test262Error: 1 setter should be unreachable! (Testing with BigInt64Array and makePassthrough.) <at omitted>",
228-
"test/built-ins/TypedArrayConstructors/internals/Set/BigInt/key-is-valid-index-reflect-set.js-strict:true": "test/built-ins/TypedArrayConstructors/internals/Set/BigInt/key-is-valid-index-reflect-set.js: Test262Error: Reflect.set should fail (receiver: another typed array of shorter length) (Testing with BigInt64Array and makePassthrough.) <at omitted>",
229-
"test/built-ins/TypedArrayConstructors/internals/Set/key-is-canonical-invalid-index-prototype-chain-set.js-strict:true": "test/built-ins/TypedArrayConstructors/internals/Set/key-is-canonical-invalid-index-prototype-chain-set.js: Test262Error: 1 setter should be unreachable! (Testing with Float64Array and makePassthrough.) <at omitted>",
230-
"test/built-ins/TypedArrayConstructors/internals/Set/key-is-canonical-invalid-index-reflect-set.js-strict:true": "test/built-ins/TypedArrayConstructors/internals/Set/key-is-canonical-invalid-index-reflect-set.js: Test262Error: 1 setter should be unreachable! (Testing with Float64Array and makePassthrough.) <at omitted>",
231-
"test/built-ins/TypedArrayConstructors/internals/Set/key-is-out-of-bounds-receiver-is-not-object.js-strict:true": "test/built-ins/TypedArrayConstructors/internals/Set/key-is-out-of-bounds-receiver-is-not-object.js: Test262Error: [[Set]] succeeeds <at omitted>",
232-
"test/built-ins/TypedArrayConstructors/internals/Set/key-is-out-of-bounds-receiver-is-proto.js-strict:true": "test/built-ins/TypedArrayConstructors/internals/Set/key-is-out-of-bounds-receiver-is-proto.js: Test262Error: valueOf is called exactly once Expected SameValue(«0», «1») to be true <at omitted>",
233-
"test/built-ins/TypedArrayConstructors/internals/Set/key-is-valid-index-reflect-set.js-strict:true": "test/built-ins/TypedArrayConstructors/internals/Set/key-is-valid-index-reflect-set.js: Test262Error: Reflect.set should fail (receiver: another typed array of shorter length) (Testing with Float64Array and makePassthrough.) <at omitted>",
234224
"test/built-ins/WeakMap/prototype/getOrInsert/adds-object-element.js-strict:true": "test/built-ins/WeakMap/prototype/getOrInsert/adds-object-element.js: TypeError: Object has no member 'getOrInsert' <at omitted>",
235225
"test/built-ins/WeakMap/prototype/getOrInsert/getOrInsert.js-strict:true": "test/built-ins/WeakMap/prototype/getOrInsert/getOrInsert.js: Test262Error: typeof WeakMap.prototype.getOrInsert is \"function\" Expected SameValue(«\"undefined\"», «\"function\"») to be true <at omitted>",
236226
"test/built-ins/WeakMap/prototype/getOrInsert/length.js-strict:true": "test/built-ins/WeakMap/prototype/getOrInsert/length.js: TypeError: Cannot convert undefined or null to object <at omitted>",
@@ -256,14 +246,10 @@
256246
"test/language/expressions/class/class-name-ident-await-module.js-strict:true": "test/language/expressions/class/class-name-ident-await-module.js: error is not an object (Test262: This statement should not be evaluated.)",
257247
"test/language/expressions/class/elements/private-getter-is-not-a-own-property.js-strict:true": "test/language/expressions/class/elements/private-getter-is-not-a-own-property.js: TypeError: Object has no member '__lookupGetter__' <at omitted>",
258248
"test/language/expressions/class/elements/private-setter-is-not-a-own-property.js-strict:true": "test/language/expressions/class/elements/private-setter-is-not-a-own-property.js: TypeError: Object has no member '__lookupSetter__' <at omitted>",
259-
"test/language/expressions/greater-than-or-equal/S11.8.4_A4.12_T1.js-strict:true": "test/language/expressions/greater-than-or-equal/S11.8.4_A4.12_T1.js: Test262Error: #10: (\"\\u{10000}\" >= \"\\uFFFF\") === false <at omitted>",
260-
"test/language/expressions/greater-than/S11.8.2_A4.12_T1.js-strict:true": "test/language/expressions/greater-than/S11.8.2_A4.12_T1.js: Test262Error: #9: (\"\\uDC00\" > \"\\uD800\") === true <at omitted>",
261249
"test/language/expressions/import.meta/import-meta-is-an-ordinary-object.js-strict:true": "test/language/expressions/import.meta/import-meta-is-an-ordinary-object.js: file:///TestTC39/test262/test/language/expressions/import.meta/import-meta-is-an-ordinary-object.js: Line 28:25 import not supported in script (and 19 more errors)",
262250
"test/language/expressions/import.meta/same-object-returned.js-strict:true": "test/language/expressions/import.meta/same-object-returned.js: file:///TestTC39/test262/test/language/expressions/import.meta/same-object-returned.js: Line 28:9 import not supported in script (and 3 more errors)",
263251
"test/language/expressions/import.meta/syntax/goal-module-nested-function.js-strict:true": "test/language/expressions/import.meta/syntax/goal-module-nested-function.js: file:///TestTC39/test262/test/language/expressions/import.meta/syntax/goal-module-nested-function.js: Line 16:3 import not supported in script (and 4 more errors)",
264252
"test/language/expressions/import.meta/syntax/goal-module.js-strict:true": "test/language/expressions/import.meta/syntax/goal-module.js: file:///TestTC39/test262/test/language/expressions/import.meta/syntax/goal-module.js: Line 15:1 import not supported in script (and 3 more errors)",
265-
"test/language/expressions/less-than-or-equal/S11.8.3_A4.12_T1.js-strict:true": "test/language/expressions/less-than-or-equal/S11.8.3_A4.12_T1.js: Test262Error: #10: (\"\\u{10000}\" <= \"\\uFFFF\") === true <at omitted>",
266-
"test/language/expressions/less-than/S11.8.1_A4.12_T1.js-strict:true": "test/language/expressions/less-than/S11.8.1_A4.12_T1.js: Test262Error: #9: (\"\\uD800\" < \"\\uDC00\") === true <at omitted>",
267253
"test/language/expressions/optional-chaining/iteration-statement-for-await-of.js-strict:true": "test/language/expressions/optional-chaining/iteration-statement-for-await-of.js: test/language/expressions/optional-chaining/iteration-statement-for-await-of.js: Line 32:7 Unexpected token await (and 9 more errors)",
268254
"test/language/expressions/optional-chaining/member-expression.js-strict:true": "test/language/expressions/optional-chaining/member-expression.js: SyntaxError: Async generators are not supported yet <at omitted>",
269255
"test/language/identifiers/part-unicode-15.1.0-class-escaped.js-strict:true": "test/language/identifiers/part-unicode-15.1.0-class-escaped.js: test/language/identifiers/part-unicode-15.1.0-class-escaped.js: Line 20:22 Unexpected token ILLEGAL (and 1 more errors)",
@@ -425,7 +411,6 @@
425411
"test/language/statements/with/get-binding-value-call-with-proxy-env.js-strict:false": "test/language/statements/with/get-binding-value-call-with-proxy-env.js: Test262Error: Actual [has:Object, get:Symbol(Symbol.unscopables), get:Object] and expected [has:Object, get:Symbol(Symbol.unscopables), has:Object, get:Object] should have the same contents. <at omitted>",
426412
"test/language/statements/with/get-binding-value-idref-with-proxy-env.js-strict:false": "test/language/statements/with/get-binding-value-idref-with-proxy-env.js: Test262Error: Actual [has:Object, get:Symbol(Symbol.unscopables), get:Object] and expected [has:Object, get:Symbol(Symbol.unscopables), has:Object, get:Object] should have the same contents. <at omitted>",
427413
"test/language/statements/with/get-mutable-binding-binding-deleted-in-get-unscopables-strict-mode.js-strict:false": "test/language/statements/with/get-mutable-binding-binding-deleted-in-get-unscopables-strict-mode.js: Test262Error: Expected a ReferenceError to be thrown but no exception was thrown at all <at omitted>",
428-
"test/language/statements/with/set-mutable-binding-binding-deleted-with-typed-array-in-proto-chain.js-strict:false": "test/language/statements/with/set-mutable-binding-binding-deleted-with-typed-array-in-proto-chain.js: Test262Error: Expected SameValue(«[object Object]», «undefined») to be true <at omitted>",
429414
"test/language/statements/with/set-mutable-binding-idref-compound-assign-with-proxy-env.js-strict:false": "test/language/statements/with/set-mutable-binding-idref-compound-assign-with-proxy-env.js: Test262Error: Actual [has:p, get:Symbol(Symbol.unscopables), get:p, set:p, getOwnPropertyDescriptor:p, defineProperty:p] and expected [has:p, get:Symbol(Symbol.unscopables), has:p, get:p, has:p, set:p, getOwnPropertyDescriptor:p, defineProperty:p] should have the same contents. <at omitted>",
430415
"test/language/statements/with/set-mutable-binding-idref-with-proxy-env.js-strict:false": "test/language/statements/with/set-mutable-binding-idref-with-proxy-env.js: Test262Error: Actual [has:p, get:Symbol(Symbol.unscopables), set:p, getOwnPropertyDescriptor:p, defineProperty:p] and expected [has:p, get:Symbol(Symbol.unscopables), has:p, set:p, getOwnPropertyDescriptor:p, defineProperty:p] should have the same contents. <at omitted>"
431416
}

0 commit comments

Comments
 (0)