JoeStrout / miniscript

source code of both C# and C++ implementations of the MiniScript scripting language
MIT License
275 stars 64 forks source link

Ensure self to be a RawData object #180

Open marcgurevitx opened 1 month ago

marcgurevitx commented 1 month ago

In the current C++ implementation of RawData there's a bug: Methods with self param accept anything that has a _handle, even an open file object.

> f = @RawData.byte
> f file.open("x.ms")  // doesn't raise an error
... ///nonsense

This PR makes it raise an index error (just like in Mini Micro).

(edit: corrected the snippet.)