Skip to content

Commit c5610ec

Browse files
committed
camelCase
1 parent b00221a commit c5610ec

File tree

10 files changed

+916
-916
lines changed

10 files changed

+916
-916
lines changed

src/native/libs/System.Runtime.InteropServices.JavaScript.Native/interop/gc-handles.ts

Lines changed: 151 additions & 151 deletions
Large diffs are not rendered by default.

src/native/libs/System.Runtime.InteropServices.JavaScript.Native/interop/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import { InternalExchangeIndex } from "../types";
66
import { dotnetUpdateInternals, dotnetUpdateInternalsSubscriber } from "./cross-module";
77
import { bindJSImportST, invokeJSImportST, setModuleImports } from "./invoke-js";
88
import { getAssemblyExports } from "./invoke-cs";
9-
import { initialize_marshalers_to_js } from "./marshal-to-js";
10-
import { initialize_marshalers_to_cs } from "./marshal-to-cs";
9+
import { initializeMarshalersToJs } from "./marshal-to-js";
10+
import { initializeMarshalersToCs } from "./marshal-to-cs";
1111

1212
export function dotnetInitializeModule(internals: InternalExchange): void {
1313
if (!Array.isArray(internals)) throw new Error("Expected internals to be an array");
@@ -25,8 +25,8 @@ export function dotnetInitializeModule(internals: InternalExchange): void {
2525
});
2626
dotnetUpdateInternals(internals, dotnetUpdateInternalsSubscriber);
2727

28-
initialize_marshalers_to_js();
29-
initialize_marshalers_to_cs();
28+
initializeMarshalersToJs();
29+
initializeMarshalersToCs();
3030

3131
// eslint-disable-next-line @typescript-eslint/no-unused-vars
3232
function runtimeExportsToTable(map: RuntimeExports): RuntimeExportsTable {

src/native/libs/System.Runtime.InteropServices.JavaScript.Native/interop/invoke-cs.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
import { assert_js_interop, bind_assembly_exports } from "./utils";
4+
import { assertJsInterop, bindAssemblyExports } from "./utils";
55

66
export const exportsByAssembly: Map<string, any> = new Map();
77

88
// eslint-disable-next-line @typescript-eslint/no-unused-vars
99
export async function getAssemblyExports(assemblyName: string): Promise<any> {
10-
assert_js_interop();
10+
assertJsInterop();
1111
const result = exportsByAssembly.get(assemblyName);
1212
if (!result) {
13-
await bind_assembly_exports(assemblyName);
13+
await bindAssemblyExports(assemblyName);
1414
}
1515

1616
return exportsByAssembly.get(assemblyName) || {};

src/native/libs/System.Runtime.InteropServices.JavaScript.Native/interop/invoke-js.ts

Lines changed: 118 additions & 118 deletions
Large diffs are not rendered by default.

src/native/libs/System.Runtime.InteropServices.JavaScript.Native/interop/marshal-to-cs.ts

Lines changed: 257 additions & 257 deletions
Large diffs are not rendered by default.

src/native/libs/System.Runtime.InteropServices.JavaScript.Native/interop/marshal-to-js.ts

Lines changed: 253 additions & 253 deletions
Large diffs are not rendered by default.

src/native/libs/System.Runtime.InteropServices.JavaScript.Native/interop/marshal.ts

Lines changed: 101 additions & 101 deletions
Large diffs are not rendered by default.

src/native/libs/System.Runtime.InteropServices.JavaScript.Native/interop/types.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ export const JSHandleNull: JSHandle = <JSHandle><any>0;
4141
export const GCHandleNull: GCHandle = <GCHandle><any>0;
4242
export const GCHandleInvalid: GCHandle = <GCHandle><any>-1;
4343

44-
export type MarshalerToJs = (arg: JSMarshalerArgument, element_type?: MarshalerType, res_converter?: MarshalerToJs, arg1_converter?: MarshalerToCs, arg2_converter?: MarshalerToCs, arg3_converter?: MarshalerToCs) => any;
45-
export type MarshalerToCs = (arg: JSMarshalerArgument, value: any, element_type?: MarshalerType, res_converter?: MarshalerToCs, arg1_converter?: MarshalerToJs, arg2_converter?: MarshalerToJs, arg3_converter?: MarshalerToJs) => void;
44+
export type MarshalerToJs = (arg: JSMarshalerArgument, elementType?: MarshalerType, resConverter?: MarshalerToJs, arg1Converter?: MarshalerToCs, arg2Converter?: MarshalerToCs, arg3Converter?: MarshalerToCs) => any;
45+
export type MarshalerToCs = (arg: JSMarshalerArgument, value: any, elementType?: MarshalerType, resConverter?: MarshalerToCs, arg1Converter?: MarshalerToJs, arg2Converter?: MarshalerToJs, arg3Converter?: MarshalerToJs) => void;
4646
export type BoundMarshalerToJs = (args: JSMarshalerArguments) => any;
4747
export type BoundMarshalerToCs = (args: JSMarshalerArguments, value: any) => void;
4848
// please keep in sync with src\libraries\System.Runtime.InteropServices.JavaScript\src\System\Runtime\InteropServices\JavaScript\MarshalerType.cs
@@ -89,13 +89,13 @@ export type BindingClosure = {
8989
fn: Function,
9090
fqn: string,
9191
isDisposed: boolean,
92-
args_count: number,
93-
arg_marshalers: (BoundMarshalerToJs)[],
94-
res_converter: BoundMarshalerToCs | undefined,
95-
has_cleanup: boolean,
96-
is_discard_no_wait: boolean,
97-
is_async: boolean,
98-
arg_cleanup: (Function | undefined)[]
92+
argsCount: number,
93+
argMarshalers: (BoundMarshalerToJs)[],
94+
resConverter: BoundMarshalerToCs | undefined,
95+
hasCleanup: boolean,
96+
isDiscardNoWait: boolean,
97+
isAsync: boolean,
98+
argCleanup: (Function | undefined)[]
9999
}
100100

101101
// TODO-WASM: drop mono prefixes, move the type

src/native/libs/System.Runtime.InteropServices.JavaScript.Native/interop/utils.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export function fixupPointer(signature: any, shiftAmount: number): any {
77
return ((signature as any) >>> shiftAmount) as any;
88
}
99

10-
export function normalize_exception(ex: any) {
10+
export function normalizeException(ex: any) {
1111
let res = "unknown exception";
1212
if (ex) {
1313
res = ex.toString();
@@ -27,16 +27,16 @@ export function normalize_exception(ex: any) {
2727
return res;
2828
}
2929

30-
export function is_runtime_running(): boolean {
30+
export function isRuntimeRunning(): boolean {
3131
// TODO-WASM
3232
return true;
3333
}
3434

35-
export function assert_runtime_running(): void {
35+
export function assertRuntimeRunning(): void {
3636
// TODO-WASM
3737
}
3838

39-
export function assert_js_interop(): void {
39+
export function assertJsInterop(): void {
4040
// TODO-WASM
4141
}
4242

@@ -51,34 +51,34 @@ export function endMeasure(mark: number, fqn: string, additionalInfo: string): v
5151
}
5252

5353
// eslint-disable-next-line @typescript-eslint/no-unused-vars
54-
export function release_js_owned_object_by_gc_handle(gc_handle: GCHandle) {
54+
export function releaseJsOwnedObjectByGcHandle(gcHandle: GCHandle) {
5555
// TODO-WASM
5656
}
5757

5858
// eslint-disable-next-line @typescript-eslint/no-unused-vars
59-
export function get_managed_stack_trace(gc_handle: GCHandle): string {
59+
export function getManagedStackTrace(gcHandle: GCHandle): string {
6060
// TODO-WASM
6161
return "";
6262
}
6363

6464
// eslint-disable-next-line @typescript-eslint/no-unused-vars
65-
export function call_delegate(callback_gc_handle: GCHandle, arg1_js: any, arg2_js: any, arg3_js: any, res_converter?: MarshalerToJs, arg1_converter?: MarshalerToCs, arg2_converter?: MarshalerToCs, arg3_converter?: MarshalerToCs) {
65+
export function callDelegate(callbackGcHandle: GCHandle, arg1Js: any, arg2Js: any, arg3Js: any, resConverter?: MarshalerToJs, arg1Converter?: MarshalerToCs, arg2Converter?: MarshalerToCs, arg3Converter?: MarshalerToCs) {
6666
}
6767

6868
// eslint-disable-next-line @typescript-eslint/no-unused-vars
69-
export function SystemInteropJS_ReleaseCSOwnedObject(js_handle: JSHandle) {
69+
export function SystemInteropJS_ReleaseCSOwnedObject(jsHandle: JSHandle) {
7070
// TODO-WASM
7171
}
7272

73-
export function isThenable(js_obj: any): boolean {
73+
export function isThenable(jsObj: any): boolean {
7474
// When using an external Promise library like Bluebird the Promise.resolve may not be sufficient
7575
// to identify the object as a Promise.
76-
return Promise.resolve(js_obj) === js_obj ||
77-
((typeof js_obj === "object" || typeof js_obj === "function") && typeof js_obj.then === "function");
76+
return Promise.resolve(jsObj) === jsObj ||
77+
((typeof jsObj === "object" || typeof jsObj === "function") && typeof jsObj.then === "function");
7878
}
7979

8080
// eslint-disable-next-line @typescript-eslint/no-unused-vars
81-
export function bind_assembly_exports(assemblyName: string): Promise<void> {
81+
export function bindAssemblyExports(assemblyName: string): Promise<void> {
8282
// TODO-WASM
8383
return Promise.resolve();
8484
}

src/native/libs/System.Runtime.InteropServices.JavaScript.Native/interop/weak-ref.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,24 @@
33

44
import { WeakRefInternal } from "./types";
55

6-
export const _use_weak_ref = typeof globalThis.WeakRef === "function";
6+
export const useWeakRef = typeof globalThis.WeakRef === "function";
77

8-
export function create_weak_ref<T extends object>(js_obj: T): WeakRefInternal<T> {
9-
if (_use_weak_ref) {
10-
return new WeakRef(js_obj);
8+
export function createWeakRef<T extends object>(jsObj: T): WeakRefInternal<T> {
9+
if (useWeakRef) {
10+
return new WeakRef(jsObj);
1111
} else {
1212
// this is trivial WeakRef replacement, which holds strong refrence, instead of weak one, when the browser doesn't support it
13-
return create_strong_ref(js_obj);
13+
return createStrongRef(jsObj);
1414
}
1515
}
1616

17-
export function create_strong_ref<T extends object>(js_obj: T): WeakRefInternal<T> {
17+
export function createStrongRef<T extends object>(jsObj: T): WeakRefInternal<T> {
1818
return <any>{
1919
deref: () => {
20-
return js_obj;
20+
return jsObj;
2121
},
2222
dispose: () => {
23-
js_obj = null!;
23+
jsObj = null!;
2424
}
2525
};
2626
}

0 commit comments

Comments
 (0)