GitLab will continue to be upgraded from 11.4.5-ce.0 on November 25th 2019 at 4.00pm (AEDT) to 5.00pm (AEDT) due to Critical Security Patch Availability. During the update, GitLab and Mattermost services will not be available.

Commit 9f1a6714 authored by Stefan Marr's avatar Stefan Marr

Cleanup inconsistencies

- delete unneeded frame primitives
- added missing __init__ to AbstractObject
- removed unused parameter from print_stack_trace
- pass instance of universe to get_class(.)
Signed-off-by: 's avatarStefan Marr <git@stefan-marr.de>
parent 91c4af20
......@@ -86,6 +86,6 @@ class ClassGenerationContext(object):
system_class.set_instance_fields(self._universe.new_array_from_list(self._instance_fields))
# class-bound == class-instance-bound
super_mclass = system_class.get_class(self._universe.nilObject)
super_mclass = system_class.get_class(self._universe)
super_mclass.set_instance_invokables(self._universe.new_array_from_list(self._class_methods))
super_mclass.set_instance_fields(self._universe.new_array_from_list(self._class_fields))
......@@ -143,7 +143,7 @@ class Frame(object):
for i in range(0, num_args):
self._stack[i] = frame.get_stack_element(num_args - 1 - i)
def print_stack_trace(self, nilObject):
def print_stack_trace(self):
# Print a stack trace starting in this frame
from som.vm.universe import std_print, std_println
std_print(self.get_method().get_holder().get_name().get_string())
......
from som.primitives.primitives import Primitives
from som.vmobjects.primitive import Primitive
def _method(ivkbl, frame, interpreter):
rcvr = frame.pop()
frame.push(rcvr.get_method())
def _previous_frame(ivkbl, frame, interpreter):
rcvr = frame.pop()
frame.push(rcvr.get_previous_frame())
class FramePrimitives(Primitives):
def install_primitives(self):
self._install_instance_primitive(Primitive("method",
self._universe, _method))
self._install_instance_primitive(Primitive("previousFrame",
self._universe, _previous_frame))
\ No newline at end of file
class AbstractObject(object):
def __init__(self):
pass
def send(self, selector_string, arguments, universe, interpreter):
# Turn the selector string into a selector
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment