dojo / core

:rocket: Dojo 2 - language helpers and utilities.
http://dojo.io
Other
213 stars 62 forks source link

Add deprecated instrumentation API #223

Closed kitsonk closed 7 years ago

kitsonk commented 7 years ago

This PR provides a new module named instrument which exports 3 functions:

deprecated allows you to log to console.warn when running in debug mode (which is the default for dojo-has) to signals that something is deprecated. It takes an options bag which allows the specification of a different message, the name of the function being deprecated, a URL for additional information and an alternative warn function.

The deprecatedAdvice generates an before advising function which will call deprecated.

The deprecatedDecorator is a method decorator which will call deprecated. It also will automatically determine the name for the options based on the class and method names.

Resolves #220

codecov-io commented 7 years ago

Current coverage is 97.42% (diff: 100%)

Merging #223 into master will increase coverage by <.01%

@@             master       #223   diff @@
==========================================
  Files            44         46     +2   
  Lines          2326       2450   +124   
  Methods          26         27     +1   
  Messages          0          0          
  Branches        445        472    +27   
==========================================
+ Hits           2266       2387   +121   
- Misses           56         59     +3   
  Partials          4          4          

Powered by Codecov. Last update 3c14776...dcfc4b7