Ejemplo n.º 1
0
 public static ZoneSpecification from(
     ZoneSpecification other,
     HandleUncaughtErrorHandler handleUncaughtError = null,
     RunHandler run             = null,
     RunUnaryHandler runUnary   = null,
     RunBinaryHandler runBinary = null,
     RegisterCallbackHandler registerCallback             = null,
     RegisterUnaryCallbackHandler registerUnaryCallback   = null,
     RegisterBinaryCallbackHandler registerBinaryCallback = null,
     ErrorCallbackHandler errorCallback             = null,
     ScheduleMicrotaskHandler scheduleMicrotask     = null,
     CreateTimerHandler createTimer                 = null,
     CreatePeriodicTimerHandler createPeriodicTimer = null,
     PrintHandler print = null,
     ForkHandler fork   = null)
 {
     return(new ZoneSpecification(
                handleUncaughtError: handleUncaughtError ?? other.handleUncaughtError,
                run: run ?? other.run,
                runUnary: runUnary ?? other.runUnary,
                runBinary: runBinary ?? other.runBinary,
                registerCallback: registerCallback ?? other.registerCallback,
                registerUnaryCallback:
                registerUnaryCallback ?? other.registerUnaryCallback,
                registerBinaryCallback:
                registerBinaryCallback ?? other.registerBinaryCallback,
                errorCallback: errorCallback ?? other.errorCallback,
                scheduleMicrotask: scheduleMicrotask ?? other.scheduleMicrotask,
                createTimer: createTimer ?? other.createTimer,
                createPeriodicTimer: createPeriodicTimer ?? other.createPeriodicTimer,
                print: print ?? other.print,
                fork: fork ?? other.fork
                ));
 }
Ejemplo n.º 2
0
        public override Zone fork(ZoneSpecification specification = null, Hashtable zoneValues = null)
        {
            var          implementation = _fork;
            ZoneDelegate parentDelegate = async_._parentDelegate(implementation.zone);
            ForkHandler  handler        = implementation.function;

            return(handler(implementation.zone, parentDelegate, this, specification, zoneValues));
        }
Ejemplo n.º 3
0
        public Zone fork(Zone zone, ZoneSpecification specification, Hashtable zoneValues)
        {
            var         implementation = _delegationTarget._fork;
            _Zone       implZone       = implementation.zone;
            ForkHandler handler        = implementation.function;

            return(handler(
                       implZone, async_._parentDelegate(implZone), zone, specification, zoneValues));
        }
Ejemplo n.º 4
0
        internal _CustomZone(_Zone parent, ZoneSpecification specification, Hashtable map)
        {
            _parent = parent;
            _map    = map;

            _run = (specification.run != null)
                ? new _RunNullaryZoneFunction(this, specification.run)
                : parent._run;
            _runUnary = (specification.runUnary != null)
                ? new _RunUnaryZoneFunction(this, specification.runUnary)
                : parent._runUnary;
            _runBinary = (specification.runBinary != null)
                ? new _RunBinaryZoneFunction(this, specification.runBinary)
                : parent._runBinary;
            _registerCallback = (specification.registerCallback != null)
                ? new _RegisterNullaryZoneFunction(this, specification.registerCallback)
                : parent._registerCallback;
            _registerUnaryCallback = (specification.registerUnaryCallback != null)
                ? new _RegisterUnaryZoneFunction(
                this, specification.registerUnaryCallback)
                : parent._registerUnaryCallback;
            _registerBinaryCallback = (specification.registerBinaryCallback != null)
                ? new _RegisterBinaryZoneFunction(
                this, specification.registerBinaryCallback)
                : parent._registerBinaryCallback;
            _errorCallback = (specification.errorCallback != null)
                ? new _ZoneFunction <ErrorCallbackHandler>(
                this, specification.errorCallback)
                : parent._errorCallback;
            _scheduleMicrotask = (specification.scheduleMicrotask != null)
                ? new _ZoneFunction <ScheduleMicrotaskHandler>(
                this, specification.scheduleMicrotask)
                : parent._scheduleMicrotask;
            _createTimer = (specification.createTimer != null)
                ? new _ZoneFunction <CreateTimerHandler>(this, specification.createTimer)
                : parent._createTimer;
            _createPeriodicTimer = (specification.createPeriodicTimer != null)
                ? new _ZoneFunction <CreatePeriodicTimerHandler>(
                this, specification.createPeriodicTimer)
                : parent._createPeriodicTimer;
            _print = (specification.print != null)
                ? new _ZoneFunction <PrintHandler>(this, specification.print)
                : parent._print;
            _fork = (specification.fork != null)
                ? new _ZoneFunction <ForkHandler>(this, specification.fork)
                : parent._fork;
            _handleUncaughtError = (specification.handleUncaughtError != null)
                ? new _ZoneFunction <HandleUncaughtErrorHandler>(
                this, specification.handleUncaughtError)
                : parent._handleUncaughtError;
        }
Ejemplo n.º 5
0
 public abstract Zone fork(ZoneSpecification specification = null, Hashtable zoneValues = null);
Ejemplo n.º 6
0
 public override Zone fork(ZoneSpecification specification = null, Hashtable zoneValues = null)
 {
     return(async_._rootFork(null, null, this, specification, zoneValues));
 }