Skip to content
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
12 changes: 6 additions & 6 deletions src/data/p5.TypedDict.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ p5.TypedDict = class TypedDict {
if (this.data.hasOwnProperty(key)) {
return this.data[key];
} else {
console.log(`${key} does not exist in this Dictionary`);
p5._friendlyError(`${key} does not exist in this Dictionary`);
}
}

Expand All @@ -191,7 +191,7 @@ p5.TypedDict = class TypedDict {
if (this._validate(value)) {
this.data[key] = value;
} else {
console.log('Those values dont work for this dictionary type.');
p5._friendlyError('Those values dont work for this dictionary type.');
}
}

Expand Down Expand Up @@ -235,7 +235,7 @@ p5.TypedDict = class TypedDict {
} else if (typeof key !== 'undefined') {
this.set(key, value);
} else {
console.log(
p5._friendlyError(
'In order to create a new Dictionary entry you must pass ' +
'an object or a key, value pair'
);
Expand Down Expand Up @@ -459,7 +459,7 @@ p5.NumberDict = class NumberDict extends p5.TypedDict {
if (this.data.hasOwnProperty(key)) {
this.data[key] += amount;
} else {
console.log(`The key - ${key} does not exist in this dictionary.`);
p5._friendlyError(`The key - ${key} does not exist in this dictionary.`);
}
}

Expand Down Expand Up @@ -509,7 +509,7 @@ p5.NumberDict = class NumberDict extends p5.TypedDict {
if (this.data.hasOwnProperty(key)) {
this.data[key] *= amount;
} else {
console.log(`The key - ${key} does not exist in this dictionary.`);
p5._friendlyError(`The key - ${key} does not exist in this dictionary.`);
}
}

Expand All @@ -536,7 +536,7 @@ p5.NumberDict = class NumberDict extends p5.TypedDict {
if (this.data.hasOwnProperty(key)) {
this.data[key] /= amount;
} else {
console.log(`The key - ${key} does not exist in this dictionary.`);
p5._friendlyError(`The key - ${key} does not exist in this dictionary.`);
}
}

Expand Down