-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Description
Hello, and such good code you have here!
I have a small problem with some code I am playing with, copied and pasted from your examples, but with an intentional typo:
begin
s.run(priv, 'puts "here we go"
x = X.new
x.foo
x.bar
x.xprivileged_operation # FAIL
', source: '<user code>')
rescue SecurityError => e
puts "privileged_operation failed due security error:\n#{e.to_s}\n"
rescue Exception => e
puts "backtrace:\n#{e.to_s}\n"
e.backtrace.each { |l| puts l }
end
Seems to me like the offending line number there is line 6, but it gets reported as 12:
undefined method `xprivileged_operation' for class `X'
...
<user code>:12:in `<module:SandboxBasenamespace96278636>'
<user code>:1:in `<top (required)>'
I see a pattern on my tests: the line counter gets the lines double and inits at 2, not at zero. And then it ignores blank lines and comments lines...
Metadata
Metadata
Assignees
Labels
No labels