-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Comment EmitThe issue relates to the emission of comments when compilingThe issue relates to the emission of comments when compilingFixedA PR has been merged for this issueA PR has been merged for this issue
Milestone
Description
Case 1
typescript
try {
// AB: might throw if a property is readonly
data[key] = null;
} catch(e) {
// AB: Here we are swallowing the exception on the attempt to write to a read-only property.
// An alternative for using try/catch would be to use Object.getOwnPropertyDescriptor
// which, when called for every single enumerable property, is slow, compared to
// a few failed attempts to write to read only.
}
javascript
try {
// AB: might throw if a property is readonly
data[key] = null;
}
catch (e) {
}
Case 2
typescript
try {
stack = undefined;
/* tslint:disable:no-throw */
throw new Error();
/* tslint:enable:no-throw */
} catch (e) {
stack = e.stack.split('\n');
}
javascript
try {
stack = undefined;
/* tslint:disable:no-throw */
throw new Error();
}
catch (e) {
stack = e.stack.split('\n');
}
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Comment EmitThe issue relates to the emission of comments when compilingThe issue relates to the emission of comments when compilingFixedA PR has been merged for this issueA PR has been merged for this issue