fix: move deprecation warning to correct fromJson (#6831)

Resolves #6830.

https://groups.google.com/g/blockly/c/uy_8e7Q8XEw/m/8XveAYi3AQAJ
This commit is contained in:
Neil Fraser
2023-02-07 23:37:25 +01:00
committed by GitHub
parent 1169b04a45
commit 72b2af2100

View File

@@ -73,6 +73,9 @@ export abstract class Abstract {
* @param json JSON representation.
*/
fromJson(json: AbstractEventJson) {
deprecation.warn(
'Blockly.Events.Abstract.prototype.fromJson', 'version 9', 'version 10',
'Blockly.Events.fromJson');
this.isBlank = false;
this.group = json['group'] || '';
}
@@ -88,9 +91,6 @@ export abstract class Abstract {
*/
static fromJson(json: AbstractEventJson, workspace: Workspace, event: any):
Abstract {
deprecation.warn(
'Blockly.Events.Abstract.prototype.fromJson', 'version 9', 'version 10',
'Blockly.Events.fromJson');
event.isBlank = false;
event.group = json['group'] || '';
event.workspaceId = workspace.id;