123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 |
- define(["amber/boot"
- //>>excludeStart("imports", pragmas.excludeImports);
- , "trapped/Trapped-Processors"
- //>>excludeEnd("imports");
- , "amber_core/Kernel-Objects"], function($boot
- //>>excludeStart("imports", pragmas.excludeImports);
- //>>excludeEnd("imports");
- ){"use strict";
- if(!$boot.nilAsReceiver)$boot.nilAsReceiver=$boot.nil;
- if(!("nilAsValue" in $boot))$boot.nilAsValue=$boot.nilAsReceiver;
- var $core=$boot.api,nil=$boot.nilAsValue,$nil=$boot.nilAsReceiver,$recv=$boot.asReceiver,$globals=$boot.globals;
- if(!$boot.nilAsClass)$boot.nilAsClass=$boot.dnu;
- $core.addPackage("Trapped-Counter");
- $core.packages["Trapped-Counter"].innerEval = function (expr) { return eval(expr); };
- $core.packages["Trapped-Counter"].imports = ["trapped/Trapped-Processors"];
- $core.packages["Trapped-Counter"].transport = {"type":"amd","amdNamespace":"trapped-counter"};
- $core.addClass("TrappedCounter", $globals.Object, ["value"], "Trapped-Counter");
- $core.addMethod(
- $core.method({
- selector: "decrement",
- protocol: "action",
- fn: function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $self["@value"]=$recv($self["@value"]).__minus((1));
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"decrement",{},$globals.TrappedCounter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "decrement\x0a\x09value := value - 1",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["-"]
- }),
- $globals.TrappedCounter);
- $core.addMethod(
- $core.method({
- selector: "increment",
- protocol: "action",
- fn: function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $self["@value"]=$recv($self["@value"]).__plus((1));
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"increment",{},$globals.TrappedCounter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "increment\x0a\x09value := value + 1",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["+"]
- }),
- $globals.TrappedCounter);
- $core.addMethod(
- $core.method({
- selector: "initialize",
- protocol: "initialization",
- fn: function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- (
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.supercall = true,
- //>>excludeEnd("ctx");
- ($globals.TrappedCounter.superclass||$boot.nilAsClass).fn.prototype._initialize.apply($self, []));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.supercall = false;
- //>>excludeEnd("ctx");;
- $self["@value"]=(0);
- $self._axxord_($recv($globals.SimpleAxon)._new());
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.TrappedCounter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "initialize\x0a\x09super initialize.\x0a\x09value := 0.\x0a\x09self axxord: SimpleAxon new",
- referencedClasses: ["SimpleAxon"],
- //>>excludeEnd("ide");
- messageSends: ["initialize", "axxord:", "new"]
- }),
- $globals.TrappedCounter);
- $core.addMethod(
- $core.method({
- selector: "value",
- protocol: "accessing",
- fn: function (){
- var self=this,$self=this;
- return $self["@value"];
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "value\x0a\x09^value",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.TrappedCounter);
- $core.addMethod(
- $core.method({
- selector: "value:",
- protocol: "accessing",
- fn: function (aNumber){
- var self=this,$self=this;
- $self["@value"]=aNumber;
- return self;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aNumber"],
- source: "value: aNumber\x0a\x09value := aNumber",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.TrappedCounter);
- });
|