core-decorators
Advanced tools
Comparing version 0.1.1 to 0.1.2
{ | ||
"name": "core-decorators", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Library of ES7 decorators inspired by languages that come with built-ins like @override, @deprecated, etc", | ||
@@ -5,0 +5,0 @@ "main": "lib/core-decorators.js", |
@@ -62,10 +62,10 @@ # core-decorators.js [![Build Status](https://travis-ci.org/jayphelps/core-decorators.js.svg?branch=master)](https://travis-ci.org/jayphelps/core-decorators.js) | ||
class Hobbit { | ||
class Meal { | ||
@readonly | ||
name = 'Bilbo Baggins'; | ||
entree = 'steak'; | ||
} | ||
var bilbo = new Hobbit(); | ||
bilbo.name = 'Frodo Baggins'; | ||
// Cannot assign to read only property 'name' of [object Object] | ||
var dinner = new Meal(); | ||
dinner.entree = 'salmon'; | ||
// Cannot assign to read only property 'entree' of [object Object] | ||
@@ -84,3 +84,3 @@ ``` | ||
class Parent { | ||
kickDog(first, second) {} | ||
speak(first, second) {} | ||
} | ||
@@ -90,4 +90,4 @@ | ||
@override | ||
kickDog() {} | ||
// SyntaxError: Child#kickDog() does not properly override Parent#kickDog(first, second) | ||
speak() {} | ||
// SyntaxError: Child#speak() does not properly override Parent#speak(first, second) | ||
} | ||
@@ -99,6 +99,6 @@ | ||
@override | ||
kickDogs() {} | ||
// SyntaxError: No descriptor matching Child#kickDogs() was found on the prototype chain. | ||
speaks() {} | ||
// SyntaxError: No descriptor matching Child#speaks() was found on the prototype chain. | ||
// | ||
// Did you mean "kickDog"? | ||
// Did you mean "speak"? | ||
} | ||
@@ -116,9 +116,9 @@ ``` | ||
@deprecate | ||
kickDog() {} | ||
facepalm() {} | ||
@deprecate('We stopped animal abuse') | ||
kickDogHard() {} | ||
@deprecate('We stopped facepalming') | ||
facepalmHard() {} | ||
@deprecate('We stopped animal abuse', { url: 'http://humanesociety.org/issues/abuse_neglect/' }) | ||
kickDogHarder() {} | ||
@deprecate('We stopped facepalming', { url: 'http://knowyourmeme.com/memes/facepalm' }) | ||
facepalmHarder() {} | ||
} | ||
@@ -128,12 +128,12 @@ | ||
person.kickDog(); | ||
// DEPRECATION Person#kickDog: This function will be removed in future versions. | ||
person.facepalm(); | ||
// DEPRECATION Person#facepalm: This function will be removed in future versions. | ||
person.kickDogHard(); | ||
// DEPRECATION Person#kickDogHard: We stopped animal abuse | ||
person.facepalmHard(); | ||
// DEPRECATION Person#facepalmHard: We stopped facepalming | ||
person.kickDogHarder(); | ||
// DEPRECATION Person#kickDogHarder: We stopped animal abuse | ||
person.facepalmHarder(); | ||
// DEPRECATION Person#facepalmHarder: We stopped facepalming | ||
// | ||
// See http://humanesociety.org/issues/abuse_neglect/ for more details. | ||
// See http://knowyourmeme.com/memes/facepalm for more details. | ||
// | ||
@@ -153,7 +153,7 @@ ``` | ||
@deprecated | ||
kickDog() {} | ||
facepalm() {} | ||
@suppressWarnings | ||
kickDogWithoutWarning() { | ||
this.kickDog(); | ||
facepalmWithoutWarning() { | ||
this.facepalm(); | ||
} | ||
@@ -164,3 +164,3 @@ } | ||
person.kickDogWithoutWarning(); | ||
person.facepalmWithoutWarning(); | ||
// no warning is logged | ||
@@ -172,6 +172,1 @@ ``` | ||
Initial implementation included, likely slow. WIP. | ||
## Disclaimer | ||
Please don't kick dogs. It's not nice. | ||
![adorable dog](https://cloud.githubusercontent.com/assets/762949/7152487/b0fec1ce-e2f1-11e4-9207-93fb1422381c.gif) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
42069
164