-
Notifications
You must be signed in to change notification settings - Fork 304
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JS/TS] Don't generate the setter code if a property is decorated wit…
- Loading branch information
1 parent
b4eb58f
commit e98cf5e
Showing
7 changed files
with
67 additions
and
1 deletion.
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
12 changes: 12 additions & 0 deletions
12
tests/Integration/Integration/data/eraseAttribute/ErasedProperty.fs
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,12 @@ | ||
module ErasedProperty | ||
|
||
open Fable.Core | ||
|
||
|
||
// This test is to make sure that we are retrieving the Erase attribute from the erased property | ||
// and not the declaring type | ||
|
||
type internal LanguageInjectionAttribute() = | ||
|
||
[<Erase>] | ||
member val Prefix = "" with get, set |
16 changes: 16 additions & 0 deletions
16
tests/Integration/Integration/data/eraseAttribute/ErasedProperty.js.expected
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,16 @@ | ||
import { class_type } from "./fable_modules/fable-library-js.5.0.0-alpha.3/Reflection.js"; | ||
|
||
export class LanguageInjectionAttribute { | ||
constructor() { | ||
this["Prefix@"] = ""; | ||
} | ||
} | ||
|
||
export function LanguageInjectionAttribute_$reflection() { | ||
return class_type("ErasedProperty.LanguageInjectionAttribute", undefined, LanguageInjectionAttribute); | ||
} | ||
|
||
export function LanguageInjectionAttribute_$ctor() { | ||
return new LanguageInjectionAttribute(); | ||
} | ||
|
12 changes: 12 additions & 0 deletions
12
tests/Integration/Integration/data/eraseAttribute/ErasedTypeWithProperty.fs
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,12 @@ | ||
module ErasedTypeWithProperty | ||
|
||
open Fable.Core | ||
|
||
[<Erase>] | ||
type internal LanguageInjectionAttribute() = | ||
|
||
[<Erase>] | ||
member val Prefix = "" with get, set | ||
|
||
// Force Fable to generate a file, otherwise because everything is erased, it will not generate anything | ||
let a = 0 |
3 changes: 3 additions & 0 deletions
3
tests/Integration/Integration/data/eraseAttribute/ErasedTypeWithProperty.js.expected
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 const a = 0; | ||
|
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