Skip to content
This repository was archived by the owner on Dec 4, 2023. It is now read-only.

Commit 46713f8

Browse files
committed
adjust function_spec to use maybe apis
1 parent e1c8f9e commit 46713f8

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

spec/c/function_spec.rb

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,9 @@ def call(info)
9090

9191
def run(source)
9292
source = V8::C::String.NewFromUtf8(@isolate, source.to_s)
93-
filename = V8::C::String.NewFromUtf8(@isolate, "<eval>")
94-
script = V8::C::Script.Compile(source, filename)
95-
result = script.Run(@ctx)
96-
97-
result.kind_of?(V8::C::String) ? result.Utf8Value : result
93+
script = V8::C::Script.Compile(@ctx, source)
94+
result = script.FromJust().Run(@ctx)
95+
checked = result.FromJust()
96+
checked.kind_of?(V8::C::String) ? checked.Utf8Value : checked
9897
end
9998
end

0 commit comments

Comments
 (0)