MCPcopy Create free account
hub / github.com/apache/fory / assertNameNotDuplicate

Method assertNameNotDuplicate

javascript/packages/core/lib/gen/scope.ts:47–58  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

45 }
46
47 assertNameNotDuplicate(name: string) {
48 for (const item of this.declares.values()) {
49 if (item === name) {
50 throw new Error(`const ${name} declare duplicate`);
51 }
52 }
53 for (const item of this.varDeclares.keys()) {
54 if (item === name) {
55 throw new Error(`let ${name} declare duplicate`);
56 }
57 }
58 }
59
60 declare(prefix: string, stmt: string) {
61 return this.addDeclar(stmt, this.uniqueName(prefix));

Callers 1

toSerializerFunction · 0.80

Calls 2

valuesMethod · 0.45
keysMethod · 0.45

Tested by

no test coverage detected