-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'NaridaL-class-name-not-changed' into release-0.56.5
# Conflicts: # src/ast/nodes/ClassDeclaration.ts # src/finalisers/es.ts
- Loading branch information
Showing
16 changed files
with
142 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export class MyClass { | ||
constructor() { } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module.exports = { | ||
description: 'class name should not be changed, even if symbol is renamed', | ||
options: { output: { name: 'myBundle' } } | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
define(['exports'], function (exports) { 'use strict'; | ||
|
||
class MyClass { | ||
constructor() { } | ||
} | ||
|
||
let MyClass$1 = class MyClass { | ||
constructor() { } | ||
}; /* comment */ functionCall(); | ||
assert.equal(MyClass$1.name, "MyClass"); // oops | ||
|
||
exports.MyClass = MyClass$1; | ||
exports.MyClass2 = MyClass; | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
'use strict'; | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
class MyClass { | ||
constructor() { } | ||
} | ||
|
||
let MyClass$1 = class MyClass { | ||
constructor() { } | ||
}; /* comment */ functionCall(); | ||
assert.equal(MyClass$1.name, "MyClass"); // oops | ||
|
||
exports.MyClass = MyClass$1; | ||
exports.MyClass2 = MyClass; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
class MyClass { | ||
constructor() { } | ||
} | ||
|
||
let MyClass$1 = class MyClass { | ||
constructor() { } | ||
}; /* comment */ functionCall(); | ||
assert.equal(MyClass$1.name, "MyClass"); // oops | ||
|
||
export { MyClass$1 as MyClass, MyClass as MyClass2 }; |
18 changes: 18 additions & 0 deletions
18
test/form/samples/class-name-not-changed/_expected/iife.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
var myBundle = (function (exports) { | ||
'use strict'; | ||
|
||
class MyClass { | ||
constructor() { } | ||
} | ||
|
||
let MyClass$1 = class MyClass { | ||
constructor() { } | ||
}; /* comment */ functionCall(); | ||
assert.equal(MyClass$1.name, "MyClass"); // oops | ||
|
||
exports.MyClass = MyClass$1; | ||
exports.MyClass2 = MyClass; | ||
|
||
return exports; | ||
|
||
}({})); |
17 changes: 17 additions & 0 deletions
17
test/form/samples/class-name-not-changed/_expected/system.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
System.register([], function (exports, module) { | ||
'use strict'; | ||
return { | ||
execute: function () { | ||
|
||
class MyClass { | ||
constructor() { } | ||
} exports('MyClass2', MyClass); | ||
|
||
let MyClass$1 = class MyClass { | ||
constructor() { } | ||
}; exports('MyClass', MyClass$1); /* comment */ functionCall(); | ||
assert.equal(MyClass$1.name, "MyClass"); // oops | ||
|
||
} | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : | ||
typeof define === 'function' && define.amd ? define(['exports'], factory) : | ||
(factory((global.myBundle = {}))); | ||
}(this, (function (exports) { 'use strict'; | ||
|
||
class MyClass { | ||
constructor() { } | ||
} | ||
|
||
let MyClass$1 = class MyClass { | ||
constructor() { } | ||
}; /* comment */ functionCall(); | ||
assert.equal(MyClass$1.name, "MyClass"); // oops | ||
|
||
exports.MyClass = MyClass$1; | ||
exports.MyClass2 = MyClass; | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
}))); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export class MyClass { | ||
constructor() { } | ||
} /* comment */ functionCall() | ||
assert.equal(MyClass.name, "MyClass") // oops | ||
export { MyClass as MyClass2 } from "./MyClass" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export class MyClass { | ||
constructor() { } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
description: 'class name should not be changed, even if symbol is renamed' | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export class MyClass { | ||
constructor() { } | ||
} | ||
assert.equal(MyClass.name, "MyClass") // oops | ||
export { MyClass as MyClass2 } from "./MyClass" |