# reopenClass method can not pass attribute named name of it?

**URL:** <https://discuss.emberjs.com/t/reopenclass-method-can-not-pass-attribute-named-name-of-it/10189>\
**Category:** Uncategorized\
**Created:** [March 18, 2016, 7:31am UTC](https://discuss.emberjs.com/t/reopenclass-method-can-not-pass-attribute-named-name-of-it/10189 "2016-03-18T07:31:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ubuntuvim](https://avatars.discourse-cdn.com/v4/letter/u/a4c791/32.png) [@ubuntuvim](https://discuss.emberjs.com/u/ubuntuvim)\
**Post date:** [March 18, 2016, 7:31am UTC](https://discuss.emberjs.com/t/reopenclass-method-can-not-pass-attribute-named-name-of-it/10189/1 "2016-03-18T07:31:09Z")

</div>

I am learning to use `reopenClass` method when I was introduced to a property called `name`, but when I run the code when an error occurs, the following error message, but I changed the name of another property, but no problem. I find this method of API, we did not see the instructions. I guess the name is not the method `reopenClass` reserved keywords?

**Error message**

```auto
ember.debug.js:18772 Uncaught TypeError: Cannot assign to read only property 'name' of function 'function () {
if (!wasApplied) {
  Class.proto(); // prepare prototype...
}

if (argume...<omitted>... }'

```

**This is my code**

```nohighlight
<!doctype html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Ember.js • Guides</title> 
  <script src="http://cdn.bootcss.com/jquery/2.0.0/jquery.js"></script>
   <script src="http://cdn.bootcss.com/ember.js/2.1.0-beta.2/ember.debug.js"></script>
    <script src="http://cdn.bootcss.com/ember.js/2.1.0-beta.2/ember.prod.js"></script>
	
	<script type="text/javascript">

	MyObject = Ember.Object.extend({
	  name: 'an object'
	});

	MyObject.reopenClass({
	    canBuild: false,
		username: 'blog.ddlisting.com' 
		//Here a bit strange, do not know why you can not use the name for the 
		// custom property name will prompt this property is self-reading, 
		//using username no problem! !
		,name: 'test'  
	});

	// Gets static property values
	console.log(MyObject.canBuild); // false
	// For general property values
	console.log(MyObject.create().get('name')); // an object

	</script>
  </head>
   
   
  <body>
  
  </body>
</html>

```

[reopenClass method API](http://emberjs.com/api/classes/Ember.Object.html#method_reopenClass)

I hope you read the description, look forward to your reply. thanks !!

---

<div class="post-metadata">

**Author:** ![jasonmit](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/jasonmit/32/182_2.png) [@jasonmit](https://discuss.emberjs.com/u/jasonmit)\
**Post date:** [March 18, 2016, 9:59pm UTC](https://discuss.emberjs.com/t/reopenclass-method-can-not-pass-attribute-named-name-of-it/10189/2 "2016-03-18T21:59:40Z")

</div>

It collides with [Function.prototype.name - JavaScript | MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name)

Perhaps a more friendly error explaining this nuance would be better.

---

<div class="post-metadata">

**Author:** ![ubuntuvim](https://avatars.discourse-cdn.com/v4/letter/u/a4c791/32.png) [@ubuntuvim](https://discuss.emberjs.com/u/ubuntuvim)\
**Post date:** [March 20, 2016, 5:16pm UTC](https://discuss.emberjs.com/t/reopenclass-method-can-not-pass-attribute-named-name-of-it/10189/3 "2016-03-20T17:16:23Z")

</div>

Oh,this is the original, thank you for your answer!🙂
