Skip to content
This repository has been archived by the owner on Sep 29, 2020. It is now read-only.

suppressWarnings decorator function cannot suppress deprecated decorator function call console.warn output #152

Open
xiaofan9 opened this issue Jul 4, 2018 · 0 comments

Comments

@xiaofan9
Copy link

xiaofan9 commented Jul 4, 2018

import { suppressWarnings } from 'core-decorators';

class Person {
  @deprecated
  facepalm() {}

  @suppressWarnings
  facepalmWithoutWarning() {
    console.warn("it is not output"); // not output
    this.facepalm();
  }
}

let person = new Person();

person.facepalmWithoutWarning();
// no warning is logged

The above code actually runs, it will still be able to call console.warn and output the warning, but facepalmWithoutWarning function call console.warn is not output.

image

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant