[buffer] Add missing const
[buffer] Remove pointless breaks in switch
[buffer] Add TODO comment
[engine] Provide stub for Error.captureStackTrace()

This is needed to pass assert-based tests