2016-07-13 05:09:12 +08:00
|
|
|
const util = require('util');
|
|
|
|
const assert = require('assert');
|
|
|
|
|
|
|
|
class deprecatedClass {
|
|
|
|
}
|
|
|
|
|
|
|
|
const deprecated = util.deprecate(deprecatedClass, 'deprecatedClass is deprecated.');
|
|
|
|
|
|
|
|
const instance = new deprecated();
|
2016-08-15 06:27:40 +08:00
|
|
|
const deprecatedInstance = new deprecatedClass();
|
2016-07-13 05:09:12 +08:00
|
|
|
|
|
|
|
assert(instance instanceof deprecated);
|
|
|
|
assert(instance instanceof deprecatedClass);
|
2016-08-15 06:27:40 +08:00
|
|
|
assert(deprecatedInstance instanceof deprecated);
|
|
|
|
assert(deprecatedInstance instanceof deprecatedClass);
|