Skip to content

Commit 667eb98

Browse files
committed
BUG#36211402 Avoid field assignment on "super"
TypeScript/JavaScript uses prototype-based inheritance where fields are stored in a flat structure and not in the scope of a particular class definition in the hierarchy. This means that a field specified by a parent class can be replaced by one specified by one of the children. To signal this behaviour, starting in v5.3.0, the TypeScript compiler prevents a class from assigning values to fields specified by a parent class using "super" (microsoft/TypeScript#54056). This patch, upgrades the TypeScript compiler to the latest version and fixes the remaining issues related to the topic mentioned above that now result in compiler errors. Additionally, it also updates the launch task that runs the compiler to ensure it uses a local version of the compiler, as specified by the dependency graph of the VSCode Extension package. Change-Id: Ib3ef774028ec4587c6b8e5eaa2eb395188e0d5a1
1 parent 39e2663 commit 667eb98

File tree

7 files changed

+17
-12
lines changed

7 files changed

+17
-12
lines changed

gui/extension/.vscode/tasks.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
{
55
"label": "tsc: extension",
66
"type": "shell",
7-
"command": "tsc",
7+
"command": "./node_modules/.bin/tsc",
88
"args": [
99
"-w",
1010
"-p",
@@ -72,7 +72,7 @@
7272
{
7373
"label": "tsc: e2e",
7474
"type": "shell",
75-
"command": "tsc",
75+
"command": "./node_modules/.bin/tsc",
7676
"args": [
7777
"-w",
7878
"-p",

gui/extension/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
- BUG#36027690 Connection error when opening REST Object Request Path in Web Browser
88
- BUG#36032142 Unexpected error when deleting records with filter containing nullables
99
- BUG#36173373 Parent class field not accessible in the child class in the TypeScript SDK
10+
- BUG#36211402 Unexpected compilation error when building the VSCode Extension
1011

1112
## Changes in 1.14.2+8.1.1
1213

gui/extension/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1636,7 +1636,7 @@
16361636
"eslint-plugin-jsdoc": "46.8.2",
16371637
"eslint-plugin-prefer-arrow": "1.2.3",
16381638
"oci-mysql": "2.73.0",
1639-
"typescript": "5.2.2"
1639+
"typescript": "5.3.3"
16401640
},
16411641
"scripts": {
16421642
"build-dev-package": "vsce package",

gui/frontend/package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gui/frontend/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
"selenium-webdriver": "4.16.0",
8686
"terser": "5.24.0",
8787
"ts-node": "10.9.1",
88-
"typescript": "5.2.2",
88+
"typescript": "5.3.3",
8989
"vite": "4.5.0",
9090
"vite-plugin-monaco-editor": "1.1.0"
9191
},
@@ -95,4 +95,4 @@
9595
"not ie <= 11",
9696
"not op_mini all"
9797
]
98-
}
98+
}

gui/frontend/src/parsing/python/PythonLexerBase.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021, 2023, Oracle and/or its affiliates.
2+
* Copyright (c) 2021, 2024, Oracle and/or its affiliates.
33
*
44
* This program is free software; you can redistribute it and/or modify
55
* it under the terms of the GNU General Public License, version 2.0,
@@ -48,7 +48,11 @@ export abstract class PythonLexerBase extends Lexer {
4848
return super.emit();
4949
}
5050

51-
super._token = token;
51+
// The _token field is handled by the parent Lexer class, however, the TypeScript compiler now prevents field
52+
// assignment using "super", because fields are kept in a flat structure in the prototype chain and there are no
53+
// assurances they are not rewritten by the child classes.
54+
// Until the Lexer class introduces a setter for this specific field, use we can replace "super" by "this".
55+
this._token = token;
5256
this.buffer.push(token);
5357
this.lastToken = token;
5458

mrs_plugin/sdk/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"eslint-plugin-jsx-a11y": "6.7.1",
2626
"eslint-plugin-prefer-arrow": "1.2.3",
2727
"preact": "10.19.2",
28-
"typescript": "4.9.5",
28+
"typescript": "5.3.3",
2929
"vitest": "0.33.0"
3030
}
3131
}

0 commit comments

Comments
 (0)