dart-lang / sdk

The Dart SDK, including the VM, JS and Wasm compilers, analysis, core libraries, and more.
https://dart.dev
BSD 3-Clause "New" or "Revised" License
10.23k stars 1.57k forks source link

dart2js keep function or class #51638

Open Super-Crab opened 1 year ago

Super-Crab commented 1 year ago

@pragma('dart2js:noElision') is just working for keep unused fields or unused parameters ,I want to keep a function or class, what should I do

rakudrama commented 1 year ago

What are you trying to do? There would be no way to access the function of class.

Super-Crab commented 1 year ago

i wantI want to keep some specific functions even though they are not used, so I would like to know if there is any solution @rakudrama

rakudrama commented 1 year ago

There is no way to declare that a function or class should be retained by dart2js.

Please could you describe what you are trying to do? If we understand what you want to do we can perhaps suggest a solution for your need.