Skip to content
This repository was archived by the owner on Aug 24, 2022. It is now read-only.

Suppress type duplicates warning #1028

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions JSIL.Libraries/Sources/JSIL.Core.js
Original file line number Diff line number Diff line change
Expand Up @@ -1160,13 +1160,15 @@ JSIL.DefineTypeName = function (name, getter, isPublic) {
};

if (existingAssembly != undefined) {
JSIL.WarningFormat(
"Public type '{0}' defined twice: {1} and {2}",
[name, existingAssembly.toString(), $private.toString()]
);
if (jsilConfig.suppressTypeDuplicatesReport !== true) {
JSIL.WarningFormat(
"Public type '{0}' defined twice: {1} and {2}",
[name, existingAssembly.toString(), $private.toString()]
);
}

delete JSIL.$PublicTypeAssemblies[key];
} else {
} else if (jsilConfig.suppressTypeDuplicatesReport !== true) {
JSIL.WarningFormat(
"Public type '{0}' defined more than twice: {1} and several other assemblies",
[name, $private.toString()]
Expand All @@ -1186,16 +1188,16 @@ JSIL.DefineTypeName = function (name, getter, isPublic) {
var existing = JSIL.$PrivateTypeAssemblies[key];

if (existing !== undefined){
if (existing != $jsilcore) {
if (existing != $jsilcore && jsilConfig.suppressTypeDuplicatesReport !== true && jsilConfig.suppressPrivateTypeDuplicatesReport !== true) {
JSIL.WarningFormat(
"Private type '{0}' with external implementation defined more than twice: '{1}'",
[$private.toString(), existing.toString()]
);
}

JSIL.$PrivateTypeAssemblies[key] = $private;
}
}
}
}

var existing = $private.$typesByName[name];
if (typeof (existing) === "function")
Expand Down