Skip to content

Commit aa0a70a

Browse files
LiedtkeV8-internal LUCI CQ
authored andcommitted
[environment] Register WebAssembly.<ErrorType>.prototype.<property>
Bug: 445356784 Change-Id: I583e24a56e0e97b589a9bd796ee7e4e23cd63d0d Reviewed-on: https://chrome-internal-review.googlesource.com/c/v8/fuzzilli/+/9081258 Reviewed-by: Danylo Mocherniuk <mdanylo@google.com> Commit-Queue: Matthias Liedtke <mliedtke@google.com>
1 parent 3f940fb commit aa0a70a

File tree

1 file changed

+34
-2
lines changed

1 file changed

+34
-2
lines changed

Sources/Fuzzilli/Environment/JavaScriptEnvironment.swift

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,9 @@ public class JavaScriptEnvironment: ComponentBase {
449449
registerObjectGroup(.jsWebAssemblyException)
450450
registerObjectGroup(.jsWebAssemblyExceptionPrototype)
451451
registerObjectGroup(.jsWebAssemblyExceptionConstructor)
452+
registerObjectGroup(.jsWebAssemblyError)
453+
registerObjectGroup(.jsWebAssemblyErrorPrototype)
454+
registerObjectGroup(.jsWebAssemblyErrorConstructor)
452455
registerObjectGroup(.jsWebAssembly)
453456
registerObjectGroup(.jsWasmGlobal)
454457
registerObjectGroup(.jsWasmMemory)
@@ -2732,9 +2735,38 @@ public extension ObjectGroup {
27322735

27332736
// WebAssembly.CompileError, .LinkError, .RuntimeError don't offer anything interesting but a
27342737
// constructor.
2738+
fileprivate static let jsWebAssemblyError = ObjectGroup(
2739+
name: "WebAssemblyError",
2740+
instanceType: nil,
2741+
properties: [
2742+
"message": .jsString,
2743+
"name": .jsString,
2744+
],
2745+
methods: [:]
2746+
)
2747+
27352748
fileprivate static let webAssemblyErrorConstructorType =
2736-
ILType.constructor([.opt(.string), .opt(.object() | .string), .opt(.string)] => .object())
2737-
+ .object(withProperties: ["prototype"])
2749+
ILType.constructor([.opt(.string), .opt(.object() | .string), .opt(.string)] => jsWebAssemblyError.instanceType)
2750+
+ .object(ofGroup: "WebAssemblyErrorConstructor", withProperties: ["prototype"])
2751+
2752+
fileprivate static let jsWebAssemblyErrorPrototype = createPrototypeObjectGroup(
2753+
jsWebAssemblyError,
2754+
constructor: webAssemblyErrorConstructorType,
2755+
additionalProperties: [
2756+
"message": .jsString,
2757+
"name": .jsString,
2758+
]
2759+
)
2760+
2761+
fileprivate static let jsWebAssemblyErrorConstructor = ObjectGroup(
2762+
name: "WebAssemblyErrorConstructor",
2763+
instanceType: webAssemblyErrorConstructorType,
2764+
properties: [
2765+
"prototype": jsWebAssemblyErrorPrototype.instanceType,
2766+
],
2767+
methods: [:]
2768+
)
2769+
27382770
fileprivate static let webAssemblySuspendingConstructorType = ILType.constructor([.plain(.function())] => .object())
27392771

27402772
static let jsWebAssembly = ObjectGroup(

0 commit comments

Comments
 (0)