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

requirejs + jsface problem #35

Open
muten84 opened this issue Nov 12, 2015 · 2 comments
Open

requirejs + jsface problem #35

muten84 opened this issue Nov 12, 2015 · 2 comments

Comments

@muten84
Copy link

muten84 commented Nov 12, 2015

Hi, I'm trying to combine requirejs with jsface and i have a strange behavior.
Consider this simple project example layout:
+app/
+core/
Person.js
Student.js

I have created two classes declared in two seperate modules defined with requirejs:
Person.js:

  define(["jsface"], function() {
    Class = jsface.Class, extend = jsface.extend;

    var Person = Class(
             {constructor : function(name, age) {
            this.name = name;
            this.age = age;
        },
});return Person;};

Studen.js:

  define(["jsface","Person"], function(Person) {
    Class = jsface.Class, extend = jsface.extend;

    var Student= Class([Person],
             {constructor : function(id,name, age) {
            this.id=id;
                        Student.$super.call(this,name,age);
        },
});return Student;};

when i use Student class constructor it fails on: Student.$super.call(this,name,age); the error thrown is "$super" is not a function.
It works well if i move the Person class declaration in the same requirejs module (inside the define function of Student.js...).
It would be nice to know if this is a normal behavior or there is a jsface problem such as requirejs incompatibility.

Thanks in advance.

Luigi

@tnhu
Copy link
Owner

tnhu commented Nov 15, 2015

Hi muten84, I'm not familiar with requirejs. Could you zip an example and share a link? I'll look into it.

@muten84
Copy link
Author

muten84 commented Nov 18, 2015

Hi i understand i will provide an example as soon as possible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants