Comparing version 1.3.3 to 1.3.4
@@ -0,1 +1,8 @@ | ||
1.3.4 / 2017-01-27 | ||
================== | ||
* [[`32637be7e4`](https://github.com/TooTallNate/ref/commit/32637be7e4)] - CI stuffs (Nathan Rajlich) | ||
* [[`55716fd9e3`](https://github.com/TooTallNate/ref/commit/55716fd9e3)] - always use `defineProperty()` for `name` (Nathan Rajlich) | ||
* [[`786b73941e`](https://github.com/TooTallNate/ref/commit/786b73941e)] - **refType**: force name to writable before updating it (Joel Martin) (#67) | ||
1.3.3 / 2016-11-03 | ||
@@ -2,0 +9,0 @@ ================== |
@@ -309,3 +309,8 @@ | ||
if (_type.name) { | ||
rtn.name = _type.name + '*' | ||
Object.defineProperty(rtn, 'name', { | ||
value: _type.name + '*', | ||
configurable: true, | ||
enumerable: true, | ||
writable: true | ||
}) | ||
} | ||
@@ -312,0 +317,0 @@ return rtn |
@@ -20,3 +20,3 @@ { | ||
], | ||
"version": "1.3.3", | ||
"version": "1.3.4", | ||
"license": "MIT", | ||
@@ -31,3 +31,3 @@ "author": "Nathan Rajlich <nathan@tootallnate.net> (http://tootallnate.net)", | ||
"docs": "node docs/compile", | ||
"test": "mocha -gc --reporter spec" | ||
"test": "mocha -gc --reporter spec --use_strict" | ||
}, | ||
@@ -34,0 +34,0 @@ "dependencies": { |
@@ -22,2 +22,24 @@ | ||
it('should override and update a read-only name property', function () { | ||
// a type similar to ref-struct's StructType | ||
// used for types refType name property test | ||
function StructType() {} | ||
StructType.size = 0 | ||
StructType.indirection = 0 | ||
// read-only name property | ||
assert.equal(StructType.name, 'StructType') | ||
try { | ||
StructType.name = 'foo' | ||
} catch (err) { | ||
// ignore | ||
} | ||
assert.equal(StructType.name, 'StructType') | ||
// name property should be writable and updated | ||
var newObj = ref.refType(StructType) | ||
var newProp = Object.getOwnPropertyDescriptor(newObj, 'name') | ||
assert.equal(newProp.writable, true) | ||
assert.equal(newObj.name, 'StructType*') | ||
}) | ||
}) | ||
@@ -24,0 +46,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
434570
3028