How to use the @aurelia/kernel.Reporter function in @aurelia/kernel

To help you get started, we’ve selected a few @aurelia/kernel examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aurelia / aurelia / packages / router / dist / umd / viewport.js View on Github external
async loadContent() {
            kernel_1.Reporter.write(10000, 'Viewport loadContent', this.name);
            // No need to wait for next component activation
            if (this.content.componentInstance && !this.nextContent.componentInstance) {
                await this.content.leave(this.nextContent.instruction);
                await this.unloadContent();
            }
            if (this.nextContent.componentInstance) {
                if (this.content.componentInstance !== this.nextContent.componentInstance) {
                    this.nextContent.addComponent(this.element);
                }
                else {
                    this.connectedScope.reenableReplacedChildren();
                }
                // Only when next component activation is done
                if (this.content.componentInstance) {
                    await this.content.leave(this.nextContent.instruction);
                    if (!this.content.reentry && this.content.componentInstance !== this.nextContent.componentInstance) {
github aurelia / aurelia / packages / runtime / dist / umd / observation / computed-observer.js View on Github external
if (descriptor.configurable === false) {
            return dirtyChecker.createProperty(instance, propertyName);
        }
        if (descriptor.get != null) {
            const { constructor: { prototype: { computed: givenOverrides } } } = instance;
            // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions, @typescript-eslint/no-unnecessary-type-assertion
            const overrides = givenOverrides && givenOverrides[propertyName] || computedOverrideDefaults;
            if (descriptor.set != null) {
                if (overrides.volatile) {
                    return new GetterObserver(flags, overrides, instance, propertyName, descriptor, observerLocator);
                }
                return new CustomSetterObserver(instance, propertyName, descriptor);
            }
            return new GetterObserver(flags, overrides, instance, propertyName, descriptor, observerLocator);
        }
        throw kernel_1.Reporter.error(18, propertyName);
    }
    exports.createComputedObserver = createComputedObserver;
github aurelia / aurelia / packages / runtime / dist / umd / binding / ast.js View on Github external
connect(flags, scope, binding, part) {
            if (scope == null) {
                throw kernel_1.Reporter.error(250 /* NilScope */, this);
            }
            if (!binding) {
                throw kernel_1.Reporter.error(206 /* NoBinding */, this);
            }
            const locator = binding.locator;
            if (!locator) {
                throw kernel_1.Reporter.error(202 /* NoLocator */, this);
            }
            this.expression.connect(flags, scope, binding, part);
            const args = this.args;
            for (let i = 0, ii = args.length; i < ii; ++i) {
                args[i].connect(flags, scope, binding, part);
            }
            const converter = locator.get(this.converterKey);
            if (!converter) {
                throw kernel_1.Reporter.error(205 /* NoConverterFound */, this);
            }
            const signals = converter.signals;
            if (signals === void 0) {
github aurelia / aurelia / packages / runtime-html / dist / umd / dom.js View on Github external
convertToRenderLocation(node) {
            if (this.isRenderLocation(node)) {
                return node; // it's already a IRenderLocation (converted by FragmentNodeSequence)
            }
            if (node.parentNode == null) {
                throw kernel_1.Reporter.error(52);
            }
            const locationEnd = this.document.createComment('au-end');
            const locationStart = this.document.createComment('au-start');
            node.parentNode.replaceChild(locationEnd, node);
            locationEnd.parentNode.insertBefore(locationStart, locationEnd);
            locationEnd.$start = locationStart;
            locationStart.$nodes = null;
            return locationEnd;
        }
        createDocumentFragment(markupOrNode) {
github aurelia / aurelia / packages / runtime / dist / umd / templating / render-context.js View on Github external
resolve(handler, requestor) {
            const factory = this.factory;
            if (factory === null) { // unmet precondition: call prepare
                throw kernel_1.Reporter.error(50); // TODO: organize error codes
            }
            if (typeof factory.name !== 'string' || factory.name.length === 0) { // unmet invariant: factory must have a name
                throw kernel_1.Reporter.error(51); // TODO: organize error codes
            }
            return factory.resolve(requestor);
        }
        dispose() {
github aurelia / aurelia / packages / jit / dist / umd / expression-parser.js View on Github external
* IsValidAssignmentTarget
             * 1,3,4,5,6,7 = false
             * 2 = true
             */
            primary: switch (state.currentToken) {
                case 3077 /* ParentScope */: // $parent
                    state.assignable = false;
                    do {
                        nextToken(state);
                        access++; // ancestor
                        if (consumeOpt(state, 16392 /* Dot */)) {
                            if (state.currentToken === 16392 /* Dot */) {
                                throw kernel_1.Reporter.error(102 /* DoubleDot */, { state });
                            }
                            else if (state.currentToken === 1572864 /* EOF */) {
                                throw kernel_1.Reporter.error(105 /* ExpectedIdentifier */, { state });
                            }
                        }
                        else if (state.currentToken & 524288 /* AccessScopeTerminal */) {
                            const ancestor = access & 511 /* Ancestor */;
                            result = ancestor === 0 ? $this : ancestor === 1 ? $parent : new runtime_1.AccessThisExpression(ancestor);
                            access = 512 /* This */;
                            break primary;
                        }
                        else {
                            throw kernel_1.Reporter.error(103 /* InvalidMemberExpression */, { state });
                        }
                    } while (state.currentToken === 3077 /* ParentScope */);
                // falls through
                case 1024 /* Identifier */: // identifier
                    if (bindingType & 512 /* IsIterator */) {
                        result = new runtime_1.BindingIdentifier(state.tokenValue);
github aurelia / aurelia / packages / runtime / dist / umd / observation / binding-context.js View on Github external
static fromParent(flags, ps, bc) {
            if (ps == null) {
                throw kernel_1.Reporter.error(253 /* NilParentScope */);
            }
            return new Scope(ps, bc, OverrideContext.create(flags, bc, ps.overrideContext));
        }
    }
github aurelia / aurelia / packages / runtime / dist / umd / renderer.js View on Github external
render(flags, dom, context, renderable, targets, definition, host, parts) {
            const targetInstructions = definition.instructions;
            const instructionRenderers = this.instructionRenderers;
            if (targets.length !== targetInstructions.length) {
                if (targets.length > targetInstructions.length) {
                    throw kernel_1.Reporter.error(30);
                }
                else {
                    throw kernel_1.Reporter.error(31);
                }
            }
            let instructions;
            let target;
            let current;
            for (let i = 0, ii = targets.length; i < ii; ++i) {
                instructions = targetInstructions[i];
                target = targets[i];
                for (let j = 0, jj = instructions.length; j < jj; ++j) {
                    current = instructions[j];
                    instructionRenderers[current.type](flags, dom, context, renderable, target, current, parts);
                }
            }
github aurelia / aurelia / packages / router / dist / umd / navigator.js View on Github external
invokeCallback(entry, navigationFlags, previousEntry) {
            const instruction = { ...entry };
            instruction.navigation = navigationFlags;
            instruction.previous = this.toStoredEntry(previousEntry);
            kernel_1.Reporter.write(10000, 'callback', instruction, instruction.previous, this.entries);
            if (this.options.callback) {
                this.options.callback(instruction);
            }
        }
        toStoreableEntry(entry) {
github aurelia / aurelia / packages / runtime / dist / umd / observation / observer-locator.js View on Github external
createObserversLookup(obj) {
            const value = {};
            if (!Reflect.defineProperty(obj, '$observers', {
                enumerable: false,
                configurable: false,
                writable: false,
                value: value
            })) {
                kernel_1.Reporter.write(0, obj);
            }
            return value;
        }
        getAdapterObserver(flags, obj, propertyName, descriptor) {