Skip to content

Instantly share code, notes, and snippets.

View alexzuza's full-sized avatar
🎯
Focusing

Alexey Zuev alexzuza

🎯
Focusing
View GitHub Profile
@alexzuza
alexzuza / di_bloom.ts
Created January 29, 2019 07:43
Di bloom
// Use the raw bloomBit number to determine which bloom filter bucket we should check
// e.g: bf0 = [0 - 31], bf1 = [32 - 63], bf2 = [64 - 95], bf3 = [96 - 127], etc
const b7 = bloomBit & 0x80;
const b6 = bloomBit & 0x40;
const b5 = bloomBit & 0x20;
const tData = tView.data as number[];
if (b7) {
b6 ? (b5 ? (tData[injectorIndex + 7] |= mask) : (tData[injectorIndex + 6] |= mask)) :
(b5 ? (tData[injectorIndex + 5] |= mask) : (tData[injectorIndex + 4] |= mask));
@alexzuza
alexzuza / di_node_injector.ts
Created January 29, 2019 07:43
di nodeinjector
export class NodeInjector implements Injector {
constructor(
private _tNode: TElementNode|TContainerNode|TElementContainerNode|null,
private _lView: LView) {}
get(token: any, notFoundValue?: any): any {
return getOrCreateInjectable(this._tNode, this._lView, token, undefined, notFoundValue);
}
}
@alexzuza
alexzuza / di_r3.ts
Created January 29, 2019 07:44
di r3
export class R3Injector {
private records = new Map<Type<any>|InjectionToken<any>, Record<any>>();
...
}
@alexzuza
alexzuza / di_false_positive.ts
Created January 29, 2019 07:45
di false positive
@Component({
selector: 'my-app',
template: `
<div>
<div dirB>Hello Ivy</div>
</div>
`
})
export class AppComponent {}
@alexzuza
alexzuza / di_simple_app.ts
Created January 29, 2019 07:46
di simple app
@Component({
selector: 'my-app',
template: `
<div dirA>
<div dirB>Hello Ivy</div>
</div>
`
})
export class AppComponent {}
const path = require('path');
const webpack = require('webpack');
const regex = /firebase\/(app|firestore)/;
module.exports = {
mode: 'none',
entry: {
// This is our Express server for Dynamic universal
server: './server.ts'
@Component({
selector: 'app-root',
template: '{{ foo }}'
})
export class AppComponent {}
var _decl0_1: AppComponent = (<any>(null as any));
function _View_AppComponent_1_0(): void {
const currVal_0: any = _decl0_1.foo;
}
@Component({
selector: 'app-root',
template: '<button (click)="test($event)">Test</button>'
})
export class AppComponent {
test() {}
}
var _decl0_1: AppComponent = (<any>(null as any));
function _View_AppComponent_1_0(): void {
var _any:any = (null as any);
const pd_1:any = ((<any>_decl0_1.test(_any)) !== false);
^^^^^^^^^^
}