type
stringclasses 7
values | content
stringlengths 4
9.55k
| repo
stringlengths 7
96
| path
stringlengths 4
178
| language
stringclasses 1
value |
|---|---|---|---|---|
MethodDeclaration
|
end() {
if (this.delegate.end) {
this.delegate.end();
}
}
|
0-micon/angular
|
packages/core/src/view/services.ts
|
TypeScript
|
MethodDeclaration
|
whenRenderingDone(): Promise<any> {
if (this.delegate.whenRenderingDone) {
return this.delegate.whenRenderingDone();
}
return Promise.resolve(null);
}
|
0-micon/angular
|
packages/core/src/view/services.ts
|
TypeScript
|
MethodDeclaration
|
private createDebugContext(nativeElement: any) { return this.debugContextFactory(nativeElement); }
|
0-micon/angular
|
packages/core/src/view/services.ts
|
TypeScript
|
MethodDeclaration
|
destroyNode(node: any) {
removeDebugNodeFromIndex(getDebugNode(node) !);
if (this.delegate.destroyNode) {
this.delegate.destroyNode(node);
}
}
|
0-micon/angular
|
packages/core/src/view/services.ts
|
TypeScript
|
MethodDeclaration
|
destroy() { this.delegate.destroy(); }
|
0-micon/angular
|
packages/core/src/view/services.ts
|
TypeScript
|
MethodDeclaration
|
createElement(name: string, namespace?: string): any {
const el = this.delegate.createElement(name, namespace);
const debugCtx = this.createDebugContext(el);
if (debugCtx) {
const debugEl = new DebugElement__PRE_R3__(el, null, debugCtx);
(debugEl as{name: string}).name = name;
indexDebugNode(debugEl);
}
return el;
}
|
0-micon/angular
|
packages/core/src/view/services.ts
|
TypeScript
|
MethodDeclaration
|
createComment(value: string): any {
const comment = this.delegate.createComment(value);
const debugCtx = this.createDebugContext(comment);
if (debugCtx) {
indexDebugNode(new DebugNode__PRE_R3__(comment, null, debugCtx));
}
return comment;
}
|
0-micon/angular
|
packages/core/src/view/services.ts
|
TypeScript
|
MethodDeclaration
|
createText(value: string): any {
const text = this.delegate.createText(value);
const debugCtx = this.createDebugContext(text);
if (debugCtx) {
indexDebugNode(new DebugNode__PRE_R3__(text, null, debugCtx));
}
return text;
}
|
0-micon/angular
|
packages/core/src/view/services.ts
|
TypeScript
|
MethodDeclaration
|
appendChild(parent: any, newChild: any): void {
const debugEl = getDebugNode(parent);
const debugChildEl = getDebugNode(newChild);
if (debugEl && debugChildEl && debugEl instanceof DebugElement__PRE_R3__) {
debugEl.addChild(debugChildEl);
}
this.delegate.appendChild(parent, newChild);
}
|
0-micon/angular
|
packages/core/src/view/services.ts
|
TypeScript
|
MethodDeclaration
|
insertBefore(parent: any, newChild: any, refChild: any): void {
const debugEl = getDebugNode(parent);
const debugChildEl = getDebugNode(newChild);
const debugRefEl = getDebugNode(refChild) !;
if (debugEl && debugChildEl && debugEl instanceof DebugElement__PRE_R3__) {
debugEl.insertBefore(debugRefEl, debugChildEl);
}
this.delegate.insertBefore(parent, newChild, refChild);
}
|
0-micon/angular
|
packages/core/src/view/services.ts
|
TypeScript
|
MethodDeclaration
|
removeChild(parent: any, oldChild: any): void {
const debugEl = getDebugNode(parent);
const debugChildEl = getDebugNode(oldChild);
if (debugEl && debugChildEl && debugEl instanceof DebugElement__PRE_R3__) {
debugEl.removeChild(debugChildEl);
}
this.delegate.removeChild(parent, oldChild);
}
|
0-micon/angular
|
packages/core/src/view/services.ts
|
TypeScript
|
MethodDeclaration
|
selectRootElement(selectorOrNode: string|any, preserveContent?: boolean): any {
const el = this.delegate.selectRootElement(selectorOrNode, preserveContent);
const debugCtx = getCurrentDebugContext();
if (debugCtx) {
indexDebugNode(new DebugElement__PRE_R3__(el, null, debugCtx));
}
return el;
}
|
0-micon/angular
|
packages/core/src/view/services.ts
|
TypeScript
|
MethodDeclaration
|
setAttribute(el: any, name: string, value: string, namespace?: string): void {
const debugEl = getDebugNode(el);
if (debugEl && debugEl instanceof DebugElement__PRE_R3__) {
const fullName = namespace ? namespace + ':' + name : name;
debugEl.attributes[fullName] = value;
}
this.delegate.setAttribute(el, name, value, namespace);
}
|
0-micon/angular
|
packages/core/src/view/services.ts
|
TypeScript
|
MethodDeclaration
|
removeAttribute(el: any, name: string, namespace?: string): void {
const debugEl = getDebugNode(el);
if (debugEl && debugEl instanceof DebugElement__PRE_R3__) {
const fullName = namespace ? namespace + ':' + name : name;
debugEl.attributes[fullName] = null;
}
this.delegate.removeAttribute(el, name, namespace);
}
|
0-micon/angular
|
packages/core/src/view/services.ts
|
TypeScript
|
MethodDeclaration
|
addClass(el: any, name: string): void {
const debugEl = getDebugNode(el);
if (debugEl && debugEl instanceof DebugElement__PRE_R3__) {
debugEl.classes[name] = true;
}
this.delegate.addClass(el, name);
}
|
0-micon/angular
|
packages/core/src/view/services.ts
|
TypeScript
|
MethodDeclaration
|
removeClass(el: any, name: string): void {
const debugEl = getDebugNode(el);
if (debugEl && debugEl instanceof DebugElement__PRE_R3__) {
debugEl.classes[name] = false;
}
this.delegate.removeClass(el, name);
}
|
0-micon/angular
|
packages/core/src/view/services.ts
|
TypeScript
|
MethodDeclaration
|
setStyle(el: any, style: string, value: any, flags: RendererStyleFlags2): void {
const debugEl = getDebugNode(el);
if (debugEl && debugEl instanceof DebugElement__PRE_R3__) {
debugEl.styles[style] = value;
}
this.delegate.setStyle(el, style, value, flags);
}
|
0-micon/angular
|
packages/core/src/view/services.ts
|
TypeScript
|
MethodDeclaration
|
removeStyle(el: any, style: string, flags: RendererStyleFlags2): void {
const debugEl = getDebugNode(el);
if (debugEl && debugEl instanceof DebugElement__PRE_R3__) {
debugEl.styles[style] = null;
}
this.delegate.removeStyle(el, style, flags);
}
|
0-micon/angular
|
packages/core/src/view/services.ts
|
TypeScript
|
MethodDeclaration
|
setProperty(el: any, name: string, value: any): void {
const debugEl = getDebugNode(el);
if (debugEl && debugEl instanceof DebugElement__PRE_R3__) {
debugEl.properties[name] = value;
}
this.delegate.setProperty(el, name, value);
}
|
0-micon/angular
|
packages/core/src/view/services.ts
|
TypeScript
|
MethodDeclaration
|
listen(
target: 'document'|'windows'|'body'|any, eventName: string,
callback: (event: any) => boolean): () => void {
if (typeof target !== 'string') {
const debugEl = getDebugNode(target);
if (debugEl) {
debugEl.listeners.push(new EventListener(eventName, callback));
}
}
return this.delegate.listen(target, eventName, callback);
}
|
0-micon/angular
|
packages/core/src/view/services.ts
|
TypeScript
|
MethodDeclaration
|
parentNode(node: any): any { return this.delegate.parentNode(node); }
|
0-micon/angular
|
packages/core/src/view/services.ts
|
TypeScript
|
MethodDeclaration
|
nextSibling(node: any): any { return this.delegate.nextSibling(node); }
|
0-micon/angular
|
packages/core/src/view/services.ts
|
TypeScript
|
MethodDeclaration
|
setValue(node: any, value: string): void { return this.delegate.setValue(node, value); }
|
0-micon/angular
|
packages/core/src/view/services.ts
|
TypeScript
|
ArrowFunction
|
(oletus: 2333 tai testnet: 12333)
|
pall1997/coorgcoin
|
src/qt/locale/bitcoin_fi.ts
|
TypeScript
|
ArrowFunction
|
(oletus: 2332 or testnet: 12332)
|
pall1997/coorgcoin
|
src/qt/locale/bitcoin_fi.ts
|
TypeScript
|
ArrowFunction
|
(oletus: 127.0.0.1)
|
pall1997/coorgcoin
|
src/qt/locale/bitcoin_fi.ts
|
TypeScript
|
ArrowFunction
|
(oletus: 100)
|
pall1997/coorgcoin
|
src/qt/locale/bitcoin_fi.ts
|
TypeScript
|
ClassDeclaration
|
@NgModule({
declarations: [
AppComponent,
LoginComponent,
LoginPopupComponent,
DashboardComponent,
CardComponent,
RegisterComponent,
ChatComponent,
AboutComponent,
NavComponent, UseritemComponent,
UserlistComponent, ChatitemComponent,
ChatlistComponent, EmojiPickerComponent
],
imports: [
BrowserModule,
FormsModule,
RouterModule,
RouterModule.forRoot(routes),
NgSelectModule,
ToastrModule.forRoot(),
BrowserAnimationsModule //required for toastr
],
providers: [AuthService],
bootstrap: [AppComponent],
schemas: [ NO_ERRORS_SCHEMA]
})
export class AppModule { }
|
Arquisoft/dechat_en2b
|
src/app/app.module.ts
|
TypeScript
|
FunctionDeclaration
|
export function* loadCartItems() {
try {
const token = getToken();
if (token) {
const response = yield call(() => getRequest(routes.cartList));
yield put(recvCart(response.data));
}
} catch (e) {
yield put(getFailure(e));
}
}
|
CodeMiner84/JS-shop-front
|
src/Cart/sagas.ts
|
TypeScript
|
FunctionDeclaration
|
export function* syncCartItems() {
const cartItems = yield select(getCartFromState);
const userId = yield select(getUserId);
cartItems.map((item: CartItemModel) => {
postRequest(routes.addToCart, {
...item,
userId,
});
});
}
|
CodeMiner84/JS-shop-front
|
src/Cart/sagas.ts
|
TypeScript
|
FunctionDeclaration
|
function* getCartItems() {
try {
yield put(loading());
yield loadCartItems();
yield calculateOrderPrice();
yield put(loaded());
} catch (e) {
yield put(loaded());
yield put(getFailure(e));
}
}
|
CodeMiner84/JS-shop-front
|
src/Cart/sagas.ts
|
TypeScript
|
FunctionDeclaration
|
function* addToCart(action: AddToCart) {
try {
yield put(loading());
yield syncProductOnAdd(action.payload);
yield put(addedToCart(action.payload));
yield calculateOrderPrice();
message.success('Product is added to cart!');
yield put(loaded());
} catch (e) {
yield put(loaded());
yield put(getFailure(e));
}
}
|
CodeMiner84/JS-shop-front
|
src/Cart/sagas.ts
|
TypeScript
|
FunctionDeclaration
|
function* syncProductOnAdd(action: ProductModel) {
try {
const token = getToken();
if (!token) {
return;
}
const params = {
productId: action.id,
userId: yield select(getUserId),
title: action.title,
price: action.price,
quantity: action.quantity ? action.quantity : 1,
};
yield call(() => postRequest(routes.addToCart, params));
} catch (e) {
yield put(getFailure(e));
}
}
|
CodeMiner84/JS-shop-front
|
src/Cart/sagas.ts
|
TypeScript
|
FunctionDeclaration
|
function* removeFromCartSaga(action: RemoveFromCartProps) {
try {
yield put(loading());
const url = routes.removeFromCart.replace(':id', action.payload);
yield call(() => deleteRequest(url));
yield put(itemRemoved(action.payload));
message.success('Product was removed from cart!');
yield calculateOrderPrice();
yield put(loaded());
} catch (e) {
yield put(loaded());
yield put(getFailure(e));
message.error('Unable to remove product from cart!');
}
}
|
CodeMiner84/JS-shop-front
|
src/Cart/sagas.ts
|
TypeScript
|
FunctionDeclaration
|
function* cartRecalculate(action: RecalculateProps) {
try {
const token = getToken();
if (token) {
yield call(() =>
patchRequest(routes.cartRecalculate, {
id: action.payload.id,
quantity: action.payload.quantity,
}),
);
}
yield put(recalculated(action.payload));
yield calculateOrderPrice();
} catch (e) {
yield put(getFailure(e));
}
}
|
CodeMiner84/JS-shop-front
|
src/Cart/sagas.ts
|
TypeScript
|
FunctionDeclaration
|
function* calculateOrderPrice() {
try {
const cartItems = yield select(getCartFromState);
let price = 0;
cartItems.map((item: any) => {
price = price + parseFloat(item.quantity) * parseFloat(item.price);
});
yield put(checkoutCalc(price.toFixed(2)));
} catch (e) {
yield put(getFailure(e));
}
}
|
CodeMiner84/JS-shop-front
|
src/Cart/sagas.ts
|
TypeScript
|
FunctionDeclaration
|
export function* cartAddWatcher() {
yield takeLatest(ADD_TO_CART, addToCart);
}
|
CodeMiner84/JS-shop-front
|
src/Cart/sagas.ts
|
TypeScript
|
FunctionDeclaration
|
export function* watchCart() {
yield takeLatest(GET_CART, getCartItems);
}
|
CodeMiner84/JS-shop-front
|
src/Cart/sagas.ts
|
TypeScript
|
FunctionDeclaration
|
export function* watchRemoveFromCart() {
yield takeLatest(REMOVE_FROM_CART, removeFromCartSaga);
}
|
CodeMiner84/JS-shop-front
|
src/Cart/sagas.ts
|
TypeScript
|
FunctionDeclaration
|
export function* watchRecalculate() {
yield takeLatest(RECALCULATE_CART, cartRecalculate);
}
|
CodeMiner84/JS-shop-front
|
src/Cart/sagas.ts
|
TypeScript
|
ArrowFunction
|
(state: any) => state.auth.user.id
|
CodeMiner84/JS-shop-front
|
src/Cart/sagas.ts
|
TypeScript
|
ArrowFunction
|
(state: any) => state.cart.cartItems
|
CodeMiner84/JS-shop-front
|
src/Cart/sagas.ts
|
TypeScript
|
ArrowFunction
|
() => getRequest(routes.cartList)
|
CodeMiner84/JS-shop-front
|
src/Cart/sagas.ts
|
TypeScript
|
ArrowFunction
|
(item: CartItemModel) => {
postRequest(routes.addToCart, {
...item,
userId,
});
}
|
CodeMiner84/JS-shop-front
|
src/Cart/sagas.ts
|
TypeScript
|
ArrowFunction
|
() => postRequest(routes.addToCart, params)
|
CodeMiner84/JS-shop-front
|
src/Cart/sagas.ts
|
TypeScript
|
ArrowFunction
|
() => deleteRequest(url)
|
CodeMiner84/JS-shop-front
|
src/Cart/sagas.ts
|
TypeScript
|
ArrowFunction
|
() =>
patchRequest(routes.cartRecalculate, {
id: action.payload.id,
quantity: action.payload.quantity,
})
|
CodeMiner84/JS-shop-front
|
src/Cart/sagas.ts
|
TypeScript
|
ArrowFunction
|
(item: any) => {
price = price + parseFloat(item.quantity) * parseFloat(item.price);
}
|
CodeMiner84/JS-shop-front
|
src/Cart/sagas.ts
|
TypeScript
|
InterfaceDeclaration
|
interface AddToCart {
type: string;
payload: ProductModel;
}
|
CodeMiner84/JS-shop-front
|
src/Cart/sagas.ts
|
TypeScript
|
InterfaceDeclaration
|
interface RemoveFromCartProps {
type: string;
payload: string;
}
|
CodeMiner84/JS-shop-front
|
src/Cart/sagas.ts
|
TypeScript
|
InterfaceDeclaration
|
interface RecalculateProps {
type: string;
payload: {
id: string;
quantity: number;
};
}
|
CodeMiner84/JS-shop-front
|
src/Cart/sagas.ts
|
TypeScript
|
ArrowFunction
|
() => {
const { matomoTrackEvent } = useTracking();
const handleClick = () => {
matomoTrackEvent({
action: actions.CLICK_EXTERNAL_NAVIGATION,
name: `${eventNames.LOGO} - ${sections.HEADER}`,
});
};
const homeLink =
process.env.NODE_ENV === "production"
? "https://amsterdam.nl/"
: routes.home;
return (
<StyledHeader
css={StyledHeaderWrapper}
homeLink=""
logo={()
|
Amsterdam/vergunningcheck
|
packages/client/src/components/Header.tsx
|
TypeScript
|
ArrowFunction
|
() => {
matomoTrackEvent({
action: actions.CLICK_EXTERNAL_NAVIGATION,
name: `${eventNames.LOGO} - ${sections.HEADER}`,
});
}
|
Amsterdam/vergunningcheck
|
packages/client/src/components/Header.tsx
|
TypeScript
|
ArrowFunction
|
() => {
console.log('HTTP REST API Server running at http://localhost:' + httpServer.address().port);
}
|
tchopra91/angular-testing-course
|
server/server.ts
|
TypeScript
|
InterfaceDeclaration
|
export interface IMenuButton {
name: string;
icon?: string;
children?: IMenuItem[];
expand?: boolean;
disable?: boolean;
onTapped?: () => void;
}
|
zx648383079/Angular-ZoDream
|
src/app/context-menu/model.ts
|
TypeScript
|
InterfaceDeclaration
|
export interface IMenuDivide {
}
|
zx648383079/Angular-ZoDream
|
src/app/context-menu/model.ts
|
TypeScript
|
TypeAliasDeclaration
|
export type IMenuItem = IMenuButton | IMenuDivide;
|
zx648383079/Angular-ZoDream
|
src/app/context-menu/model.ts
|
TypeScript
|
TypeAliasDeclaration
|
export type MenuEvent = (item: IMenuButton) => void;
|
zx648383079/Angular-ZoDream
|
src/app/context-menu/model.ts
|
TypeScript
|
ArrowFunction
|
() => {
let component: Comp452Component;
let fixture: ComponentFixture<Comp452Component>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ Comp452Component ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(Comp452Component);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
}
|
angular/angular-cli-stress-test
|
src/app/components/comp-452/comp-452.component.spec.ts
|
TypeScript
|
ArrowFunction
|
() => {
TestBed.configureTestingModule({
declarations: [ Comp452Component ]
})
.compileComponents();
}
|
angular/angular-cli-stress-test
|
src/app/components/comp-452/comp-452.component.spec.ts
|
TypeScript
|
ArrowFunction
|
() => {
fixture = TestBed.createComponent(Comp452Component);
component = fixture.componentInstance;
fixture.detectChanges();
}
|
angular/angular-cli-stress-test
|
src/app/components/comp-452/comp-452.component.spec.ts
|
TypeScript
|
ArrowFunction
|
async () => {
await add_md_label(utils, await utils.getIssues(1))
console.log(utils.sectionMap.get(Constant.AGG_EACH_LABEL))
expect(utils.sectionMap.get(Constant.AGG_EACH_LABEL)).not.toContain('links')
// worst case
}
|
bxb100/issueblog
|
__tests__/label-process.test.ts
|
TypeScript
|
ArrowFunction
|
() => loyaltyAccountSchema
|
AbdullahHeshamShahin/GameballTest
|
node_modules/square/src/models/createLoyaltyAccountRequest.ts
|
TypeScript
|
InterfaceDeclaration
|
/** A request to create a new loyalty account. */
export interface CreateLoyaltyAccountRequest {
/**
* Describes a loyalty account. For more information, see
* [Loyalty Overview](https://developer.squareup.com/docs/loyalty/overview).
*/
loyaltyAccount: LoyaltyAccount;
/**
* A unique string that identifies this `CreateLoyaltyAccount` request.
* Keys can be any valid string, but must be unique for every request.
*/
idempotencyKey: string;
}
|
AbdullahHeshamShahin/GameballTest
|
node_modules/square/src/models/createLoyaltyAccountRequest.ts
|
TypeScript
|
ClassDeclaration
|
export class NoTTYReport extends CLIReport {
protected maxPathDisplay: number;
protected maxFormatDisplay: number;
protected currentLine: string;
public update(context: Context): void {
const completed: SizeMap = super.getUpdated(context);
if (this.silent) {
return;
}
for (const complete of completed) {
const [path, sizeMapValue] = complete;
const displayPath = context.originalPaths.get(path) || path;
let failure = 0;
this.currentLine = ` ${displayPath
.substring(displayPath.length - this.maxPathDisplay)
.padEnd(this.maxPathDisplay)} `;
for (let i = 0; i < OrderedCompressionValues.length; i++) {
failure += this.displaySize(sizeMapValue[i]).failure;
}
if (failure > 0) {
this.currentLine = ` ${kleur.red(ICONS['cross'])}${this.currentLine}`;
} else {
this.currentLine = ` ${kleur.dim().green(ICONS['tick'])}${this.currentLine}`;
}
write(this.currentLine + '\n');
}
}
}
|
ampproject/filesize
|
src/log/no-tty-report.ts
|
TypeScript
|
MethodDeclaration
|
public update(context: Context): void {
const completed: SizeMap = super.getUpdated(context);
if (this.silent) {
return;
}
for (const complete of completed) {
const [path, sizeMapValue] = complete;
const displayPath = context.originalPaths.get(path) || path;
let failure = 0;
this.currentLine = ` ${displayPath
.substring(displayPath.length - this.maxPathDisplay)
.padEnd(this.maxPathDisplay)} `;
for (let i = 0; i < OrderedCompressionValues.length; i++) {
failure += this.displaySize(sizeMapValue[i]).failure;
}
if (failure > 0) {
this.currentLine = ` ${kleur.red(ICONS['cross'])}${this.currentLine}`;
} else {
this.currentLine = ` ${kleur.dim().green(ICONS['tick'])}${this.currentLine}`;
}
write(this.currentLine + '\n');
}
}
|
ampproject/filesize
|
src/log/no-tty-report.ts
|
TypeScript
|
FunctionDeclaration
|
function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}
|
philipsens/xml.js
|
src/xmllint.ts
|
TypeScript
|
FunctionDeclaration
|
function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}
|
philipsens/xml.js
|
src/xmllint.ts
|
TypeScript
|
FunctionDeclaration
|
function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}
|
philipsens/xml.js
|
src/xmllint.ts
|
TypeScript
|
FunctionDeclaration
|
function convertJsFunctionToWasm(func,sig){if(typeof WebAssembly.Function==="function"){var typeNames={"i":"i32","j":"i64","f":"f32","d":"f64"};var type={parameters:[],results:sig[0]=="v"?[]:[typeNames[sig[0]]]};for(var i=1;i<sig.length;++i){type.parameters.push(typeNames[sig[i]])}return new WebAssembly.Function(type,func)}var typeSection=[1,0,1,96];var sigRet=sig.slice(0,1);var sigParam=sig.slice(1);var typeCodes={"i":127,"j":126,"f":125,"d":124};typeSection.push(sigParam.length);for(var i=0;i<sigParam.length;++i){typeSection.push(typeCodes[sigParam[i]])}if(sigRet=="v"){typeSection.push(0)}else{typeSection=typeSection.concat([1,typeCodes[sigRet]])}typeSection[1]=typeSection.length-2;var bytes=new Uint8Array([0,97,115,109,1,0,0,0].concat(typeSection,[2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0]));var module=new WebAssembly.Module(bytes);var instance=new WebAssembly.Instance(module,{"e":{"f":func}});var wrappedFunc=instance.exports["f"];return wrappedFunc}
|
philipsens/xml.js
|
src/xmllint.ts
|
TypeScript
|
FunctionDeclaration
|
function getEmptyTableSlot(){if(freeTableIndexes.length){return freeTableIndexes.pop()}try{wasmTable.grow(1)}catch(err){if(!(err instanceof RangeError)){throw err}throw"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH."}return wasmTable.length-1}
|
philipsens/xml.js
|
src/xmllint.ts
|
TypeScript
|
FunctionDeclaration
|
function addFunctionWasm(func,sig){if(!functionsInTableMap){functionsInTableMap=new WeakMap;for(var i=0;i<wasmTable.length;i++){var item=wasmTable.get(i);if(item){functionsInTableMap.set(item,i)}}}if(functionsInTableMap.has(func)){return functionsInTableMap.get(func)}var ret=getEmptyTableSlot();try{wasmTable.set(ret,func)}catch(err){if(!(err instanceof TypeError)){throw err}var wrapped=convertJsFunctionToWasm(func,sig);wasmTable.set(ret,wrapped)}functionsInTableMap.set(func,ret);return ret}
|
philipsens/xml.js
|
src/xmllint.ts
|
TypeScript
|
FunctionDeclaration
|
function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}
|
philipsens/xml.js
|
src/xmllint.ts
|
TypeScript
|
FunctionDeclaration
|
function getCFunc(ident){var func=Module["_"+ident];assert(func,"Cannot call unknown function "+ident+", make sure it is exported");return func}
|
philipsens/xml.js
|
src/xmllint.ts
|
TypeScript
|
FunctionDeclaration
|
function ccall(ident,returnType,argTypes,args,opts){var toC={"string":function(str){var ret=0;if(str!==null&&str!==undefined&&str!==0){var len=(str.length<<2)+1;ret=stackAlloc(len);stringToUTF8(str,ret,len)}return ret},"array":function(arr){var ret=stackAlloc(arr.length);writeArrayToMemory(arr,ret);return ret}};function convertReturnValue(ret){if(returnType==="string")return UTF8ToString(ret);if(returnType==="boolean")return Boolean(ret);return ret}var func=getCFunc(ident);var cArgs=[];var stack=0;if(args){for(var i=0;i<args.length;i++){var converter=toC[argTypes[i]];if(converter){if(stack===0)stack=stackSave();cArgs[i]=converter(args[i])}else{cArgs[i]=args[i]}}}var ret=func.apply(null,cArgs);ret=convertReturnValue(ret);if(stack!==0)stackRestore(stack);return ret}
|
philipsens/xml.js
|
src/xmllint.ts
|
TypeScript
|
FunctionDeclaration
|
function convertReturnValue(ret){if(returnType==="string")return UTF8ToString(ret);if(returnType==="boolean")return Boolean(ret);return ret}
|
philipsens/xml.js
|
src/xmllint.ts
|
TypeScript
|
FunctionDeclaration
|
function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var endPtr=idx;while(heap[endPtr]&&!(endPtr>=endIdx))++endPtr;if(endPtr-idx>16&&heap.subarray&&UTF8Decoder){return UTF8Decoder.decode(heap.subarray(idx,endPtr))}else{var str="";while(idx<endPtr){var u0=heap[idx++];if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}}return str}
|
philipsens/xml.js
|
src/xmllint.ts
|
TypeScript
|
FunctionDeclaration
|
function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}
|
philipsens/xml.js
|
src/xmllint.ts
|
TypeScript
|
FunctionDeclaration
|
function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i<str.length;++i){var u=str.charCodeAt(i);if(u>=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}
|
philipsens/xml.js
|
src/xmllint.ts
|
TypeScript
|
FunctionDeclaration
|
function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}
|
philipsens/xml.js
|
src/xmllint.ts
|
TypeScript
|
FunctionDeclaration
|
function lengthBytesUTF8(str){var len=0;for(var i=0;i<str.length;++i){var u=str.charCodeAt(i);if(u>=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}
|
philipsens/xml.js
|
src/xmllint.ts
|
TypeScript
|
FunctionDeclaration
|
function allocateUTF8OnStack(str){var size=lengthBytesUTF8(str)+1;var ret=stackAlloc(size);stringToUTF8Array(str,HEAP8,ret,size);return ret}
|
philipsens/xml.js
|
src/xmllint.ts
|
TypeScript
|
FunctionDeclaration
|
function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}
|
philipsens/xml.js
|
src/xmllint.ts
|
TypeScript
|
FunctionDeclaration
|
function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i<str.length;++i){HEAP8[buffer++>>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}
|
philipsens/xml.js
|
src/xmllint.ts
|
TypeScript
|
FunctionDeclaration
|
function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}
|
philipsens/xml.js
|
src/xmllint.ts
|
TypeScript
|
FunctionDeclaration
|
function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}
|
philipsens/xml.js
|
src/xmllint.ts
|
TypeScript
|
FunctionDeclaration
|
function initRuntime(){runtimeInitialized=true;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}
|
philipsens/xml.js
|
src/xmllint.ts
|
TypeScript
|
FunctionDeclaration
|
function preMain(){FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}
|
philipsens/xml.js
|
src/xmllint.ts
|
TypeScript
|
FunctionDeclaration
|
function exitRuntime(){runtimeExited=true}
|
philipsens/xml.js
|
src/xmllint.ts
|
TypeScript
|
FunctionDeclaration
|
function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}
|
philipsens/xml.js
|
src/xmllint.ts
|
TypeScript
|
FunctionDeclaration
|
function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}
|
philipsens/xml.js
|
src/xmllint.ts
|
TypeScript
|
FunctionDeclaration
|
function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}
|
philipsens/xml.js
|
src/xmllint.ts
|
TypeScript
|
FunctionDeclaration
|
function getUniqueRunDependency(id){return id}
|
philipsens/xml.js
|
src/xmllint.ts
|
TypeScript
|
FunctionDeclaration
|
function addRunDependency(id){runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}
|
philipsens/xml.js
|
src/xmllint.ts
|
TypeScript
|
FunctionDeclaration
|
function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}
|
philipsens/xml.js
|
src/xmllint.ts
|
TypeScript
|
FunctionDeclaration
|
function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}
|
philipsens/xml.js
|
src/xmllint.ts
|
TypeScript
|
FunctionDeclaration
|
function hasPrefix(str,prefix){return String.prototype.startsWith?str.startsWith(prefix):str.indexOf(prefix)===0}
|
philipsens/xml.js
|
src/xmllint.ts
|
TypeScript
|
FunctionDeclaration
|
function isDataURI(filename){return hasPrefix(filename,dataURIPrefix)}
|
philipsens/xml.js
|
src/xmllint.ts
|
TypeScript
|
FunctionDeclaration
|
function isFileURI(filename){return hasPrefix(filename,fileURIPrefix)}
|
philipsens/xml.js
|
src/xmllint.ts
|
TypeScript
|
FunctionDeclaration
|
function getBinary(){try{if(wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(wasmBinaryFile)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}
|
philipsens/xml.js
|
src/xmllint.ts
|
TypeScript
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.