Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Constructor is given while string is expected in can.classize function of can.Observe.setter #182

Closed
taai opened this issue Nov 29, 2012 · 2 comments
Labels

Comments

@taai
Copy link

taai commented Nov 29, 2012

Hi,

Look at this: https://github.com/bitovi/canjs/blob/master/observe/setter/setter.js#L26

proto.__set = function(prop, value, current, success, error){
    // check if there's a setter
    var cap = classize(prop),

prop should be a string, but it is a Constructor. That leads to error "TypeError: s.split is not a function" in this line of code: https://github.com/bitovi/canjs/blob/master/observe/setter/setter.js#L11

/**
  * Like [can.camelize|camelize], but the first part is also capitalized
  * @param {String} s
  * @return {String} the classized string
 */
can.classize = function( s , join) {
    // this can be moved out ..
    // used for getter setter
    var parts = s.split(can.undHash),

This is happening when using can.jquery-all.js of canJS version 1.1.2.

@daffl
Copy link
Contributor

daffl commented Dec 4, 2012

When does this happen? If you could provide a breaking Fiddle it will probably be an easy fix.

@taai
Copy link
Author

taai commented Dec 4, 2012

Just download the .zip file from http://canjs.us/ and use the can.jquery-all.js file! Then call this:

var Create = can.Control({});

I did copy that file contents and this script in this JSBin: http://jsbin.com/ekaxid/1/edit
To see the error click on "Console" to open the "Console" pane and then click on "Run with JS" to run it again and generate the error.

@daffl daffl closed this as completed in 8218717 Dec 11, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants