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

fix #394 tplScript unnecessarily extending Template #395

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 6 additions & 10 deletions src/aria/Aria.js
Expand Up @@ -154,6 +154,7 @@
Aria.RESOURCES_HANDLE_CONFLICT = "Template error: can't load resources '%1' defined in '%2'. A macro, a library, a text template, a variable or another resource has already been declared with the same name.";
Aria.CANNOT_EXTEND_SINGLETON = "Class %1 cannot extend singleton class %2";
Aria.FUNCTION_PROTOTYPE_RETURN_NULL = "Prototype function of %1 cannot returns null";
Aria.TPLSCRIPT_INSTANTIATED_DIRECTLY = "Template scripts can not be instantiated directly";

Aria.$classpath = "Aria";
/**
Expand Down Expand Up @@ -748,17 +749,12 @@
$onload : function (constructor) {
constructor.tplScriptDefinition = def;
},
$extends : "aria.templates.Template",
$constructor : function () {
this.$Template.constructor.call(this);
if (def.$constructor) {
def.$constructor.call(this);
}
},
$destructor : def.$destructor ? function () {
def.$destructor.call(this);
this.$Template.$destructor.call(this);
} : null
// This is to prevent direct instantiation of template scripts.
// Yet it is still possible do define $constructor and $destructor on template scripts, as they will be
// imported later on in TplClassLoader._importScriptPrototype()
this.$logError(Aria.TPLSCRIPT_INSTANTIATED_DIRECTLY);
}
});
};

Expand Down