MyScript.js 2.0 KB

123456789101112131415161718192021222324252627282930
  1. smalltalk.addClass('MyScript', smalltalk.Object, [], 'MyScript');
  2. smalltalk.addMethod(
  3. '_main',
  4. smalltalk.method({
  5. selector: 'main',
  6. category: 'main',
  7. fn: function (){
  8. var self=this;
  9. var class=nil;
  10. var compiler=nil;
  11. var method=nil;
  12. smalltalk.send((smalltalk.Object || Object), "_subclass_instanceVariableNames_category_", ["Dummy", "", "Dummy"]);
  13. class=smalltalk.send((typeof smalltalk == 'undefined' ? nil : smalltalk), "_at_", ["Dummy"]);
  14. compiler=smalltalk.send((smalltalk.Compiler || Compiler), "_new", []);
  15. method=smalltalk.send(compiler, "_load_forClass_", [unescape("foo%20%5E%2010"), class]);
  16. smalltalk.send(method, "_category_", ["foo"]);
  17. smalltalk.send(class, "_addCompiledMethod_", [method]);
  18. method=smalltalk.send(compiler, "_load_forClass_", [unescape("bar%20%5E%20self%20foo%20*%202"), class]);
  19. smalltalk.send(method, "_category_", ["foo"]);
  20. smalltalk.send(class, "_addCompiledMethod_", [method]);
  21. smalltalk.send((typeof console == 'undefined' ? nil : console), "_log_", [smalltalk.send(smalltalk.send((smalltalk.Exporter || Exporter), "_new", []), "_exportCategory_", ["Dummy"])]);
  22. return self;},
  23. source: unescape('main%0A%09%7C%20class%20compiler%20method%20%7C%0A%09Object%20subclass%3A%20%23Dummy%20instanceVariableNames%3A%20%27%27%20category%3A%20%27Dummy%27.%0A%09class%20%3A%3D%20smalltalk%20at%3A%20%23Dummy.%09%0A%09compiler%20%3A%3D%20Compiler%20new.%0A%0A%09method%20%3A%3D%20compiler%20load%3A%20%27foo%20%5E%2010%27%20forClass%3A%20class.%0A%09method%20category%3A%20%27foo%27.%0A%09class%20addCompiledMethod%3A%20method.%0A%0A%09method%20%3A%3D%20compiler%20load%3A%20%27bar%20%5E%20self%20foo%20*%202%27%20forClass%3A%20class.%0A%09method%20category%3A%20%27foo%27.%0A%09class%20addCompiledMethod%3A%20method.%0A%0A%09console%20log%3A%20%28Exporter%20new%20exportCategory%3A%20%27Dummy%27%29'),
  24. messageSends: ["subclass:instanceVariableNames:category:", "at:", "new", "load:forClass:", "category:", "addCompiledMethod:", "log:", "exportCategory:"],
  25. referencedClasses: [smalltalk.Object,smalltalk.Compiler,smalltalk.Exporter]
  26. }),
  27. smalltalk.MyScript.klass);