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

Development mode builds #692

Merged
merged 4 commits into from Jan 23, 2014
Jump to file or symbol
Failed to load files and symbols.
+825 −700
Diff settings

Always

Just for now

View
@@ -83,6 +83,7 @@ module.exports = function (grunt) {
builder: {
options: {
url: 'http://canjs.com',
dev: true,
pluginify: {
ignore: [ /\/lib\//, /util\/dojo-(.*?).js/ ]
},
View
@@ -12,6 +12,7 @@
"devDependencies": {
"qunit": "~1.12.0",
"zepto": "~1.0.0",
"benchmark": "~1.0.0"
"benchmark": "~1.0.0",
"requirejs": "~2.1.10"
}
}
View
@@ -21,7 +21,7 @@ <h2 id="qunit-userAgent"></h2>
<script type="text/javascript">
QUnit.config.autostart = false;
steal("can/component").then("can/component/component_test.js", function() {
QUnit.start();
can.dev.logLevel = 3; QUnit.start();
});
</script>
</body>
View
@@ -19,7 +19,7 @@ <h2 id="qunit-userAgent"></h2>
QUnit.config.autostart = false;
steal("can/compute")
.then("can/test", "can/compute/compute_test.js", function() {
QUnit.start();
can.dev.logLevel = 3; QUnit.start();
});
</script>
</body>
View
@@ -338,11 +338,11 @@ steal("can/util/string", function(can) {
_fullName = can.underscore(fullName.replace(/\./g, "_")),
_shortName = can.underscore(shortName);
//!steal-remove-start
//!dev-remove-start
if(current[shortName]){
steal.dev.warn("class.js There's already something called "+fullName)
can.dev.warn("can/construct/construct.js: There's already something called "+fullName)
}
//!steal-remove-end
//!dev-remove-end
current[shortName] = Constructor;
}
View
@@ -20,13 +20,14 @@ proxy = function( funcs ) {
// keep a reference to us in self
self = this;
//!steal-remove-start
//!dev-remove-start
for( var i =0; i< funcs.length;i++ ) {
if(typeof funcs[i] == "string" && !isFunction(this[funcs[i]])){
throw ("class.js "+( this.fullName || this.Class.fullName)+" does not have a "+funcs[i]+"method!");
}
}
//!steal-remove-end
//!dev-remove-end
return function class_cb() {
// add the arguments after the curried args
var cur = args.concat(makeArray(arguments)),
@@ -18,7 +18,7 @@ <h2 id="qunit-userAgent"></h2>
<script type="text/javascript">
QUnit.config.autostart = false;
steal("can/construct/proxy", "can/control").then("can/construct/proxy/proxy_test.js", function() {
QUnit.start();
can.dev.logLevel = 3; QUnit.start();
});
</script>
</body>
@@ -18,7 +18,7 @@ <h2 id="qunit-userAgent"></h2>
<script type="text/javascript">
QUnit.config.autostart = false;
steal("can/construct/super").then("can/construct/super/super_test.js", function() {
QUnit.start();
can.dev.logLevel = 3; QUnit.start();
});
</script>
</body>
View
@@ -22,7 +22,7 @@ <h2 id="qunit-userAgent"></h2>
root: '../'
});
},"can/construct").then("can/construct/construct_test.js", function() {
QUnit.start();
can.dev.logLevel = 3; QUnit.start();
});
</script>
</body>
View
@@ -131,7 +131,7 @@ steal('can/util','can/construct', function( can ) {
* The processor is what does the binding/subscribing.
*/
_action: function( methodName, options ) {
// If we don't have options (a `control` instance), we'll run this
// later.
paramReplacer.lastIndex = 0;
@@ -140,6 +140,9 @@ steal('can/util','can/construct', function( can ) {
// value from the options or the window
var convertedName = options ? can.sub(methodName, this._lookup(options)) : methodName;
if(!convertedName) {
//!dev-remove-start
can.dev.log('can/control/control.js: No property found for handling ' + methodName);
//!dev-remove-end
return null;
}
// If a `{}` template resolves to an object, `convertedName` will be
@@ -805,9 +808,9 @@ steal('can/util','can/construct', function( can ) {
destroy: function() {
//Control already destroyed
if(this.element === null) {
//!steal-remove-start
steal.dev.warn("Control.js - Control already destroyed");
//!steal-remove-end
//!dev-remove-start
can.dev.warn("can/control/control.js: Control already destroyed");
//!dev-remove-end
return;
}
var Class = this.constructor,
View
@@ -358,4 +358,37 @@
c.destroy();
c.destroy();
});
//!dev-remove-start
if(can.dev) {
test("Control is logging information in dev mode", function() {
expect(2);
var oldlog = can.dev.log;
var oldwarn = can.dev.warn;
can.dev.log = function(text) {
equal(text, 'can/control/control.js: No property found for handling {dummy} change',
'Text logged as expected');
}
var Control = can.Control({
'{dummy} change': function() {}
});
var instance = new Control(document.createElement('div'));
can.dev.warn = function(text) {
equal(text, 'can/control/control.js: Control already destroyed');
}
instance.destroy();
instance.destroy();
can.dev.warn = oldwarn;
can.dev.log = oldlog;
});
}
//!dev-remove-end
})();
@@ -21,7 +21,7 @@ <h2 id="qunit-userAgent"></h2>
'can/util',
'can/control'
).then('can/control/modifier/modifier_test.js', function(){
QUnit.start();
can.dev.logLevel = 3; QUnit.start();
})
</script>
</body>
View
@@ -18,7 +18,7 @@ <h2 id="qunit-userAgent"></h2>
<script type="text/javascript">
QUnit.config.autostart = false;
steal("can/control/plugin").then("can/control/plugin/plugin_test.js", function() {
QUnit.start();
can.dev.logLevel = 3; QUnit.start();
});
</script>
</body>
View
@@ -18,7 +18,7 @@ <h2 id="qunit-userAgent"></h2>
<script type="text/javascript">
QUnit.config.autostart = false;
steal("can/control/route").then("can/control/route/route_test.js", function() {
QUnit.start();
can.dev.logLevel = 3; QUnit.start();
});
</script>
</body>
View
@@ -18,7 +18,7 @@ <h2 id="qunit-userAgent"></h2>
<script type="text/javascript">
QUnit.config.autostart = false;
steal("can/control").then("can/control/control_test.js", function() {
QUnit.start();
can.dev.logLevel = 3; QUnit.start();
});
</script>
</body>
View
@@ -16,7 +16,7 @@ <h2 id="qunit-userAgent"></h2>
<script type="text/javascript">
QUnit.config.autostart = false;
steal("can/control/view").then("can/control/view/test/view_test.js", function() {
QUnit.start();
can.dev.logLevel = 3; QUnit.start();
});
</script>
</body>
View
@@ -18,7 +18,7 @@ <h2 id="qunit-userAgent"></h2>
<script type="text/javascript">
QUnit.config.autostart = false;
steal("can/list").then("can/test", "can/list/list_test.js", function() {
QUnit.start();
can.dev.logLevel = 3; QUnit.start();
});
</script>
</body>
View
@@ -18,7 +18,7 @@ <h2 id="qunit-userAgent"></h2>
<script type="text/javascript">
QUnit.config.autostart = false;
steal("can/map/attributes", "can/model", "can/util/fixture").then("can/test", "can/map/attributes/attributes_test.js", function() {
QUnit.start();
can.dev.logLevel = 3; QUnit.start();
});
</script>
</body>
View
@@ -18,7 +18,7 @@ <h2 id="qunit-userAgent"></h2>
<script type="text/javascript">
QUnit.config.autostart = false;
steal("can/map/backup", "can/model").then("can/test", "can/map/backup/backup_test.js", function() {
QUnit.start();
can.dev.logLevel = 3; QUnit.start();
});
</script>
</body>
View
@@ -20,7 +20,7 @@ <h2 id="qunit-userAgent"></h2>
steal( "can/map")
.then("can/map/delegate")
.then("can/test", "can/map/delegate/delegate_test.js", function() {
QUnit.start();
can.dev.logLevel = 3; QUnit.start();
});
</script>
</body>
View
@@ -21,7 +21,7 @@ <h2 id="qunit-userAgent"></h2>
root: '../../'
});
},"can/map/list").then("can/map/list/list_test.js", function() {
QUnit.start();
can.dev.logLevel = 3; QUnit.start();
});
</script>
</body>
View
@@ -18,7 +18,7 @@ <h2 id="qunit-userAgent"></h2>
<script type="text/javascript">
QUnit.config.autostart = false;
steal("can/map").then("can/map/setter", "can/test", "can/map/setter/setter_test.js", function() {
QUnit.start();
can.dev.logLevel = 3; QUnit.start();
});
</script>
</body>
View
@@ -22,7 +22,7 @@ <h2 id="qunit-userAgent"></h2>
"can/test",
"can/view/mustache",
"can/map/sort/sort_test.js", function() {
QUnit.start();
can.dev.logLevel = 3; QUnit.start();
});
</script>
</body>
View
@@ -18,7 +18,7 @@ <h2 id="qunit-userAgent"></h2>
<script type="text/javascript">
QUnit.config.autostart = false;
steal("can/map", "can/compute").then("can/test", "can/map/map_test.js", function() {
QUnit.start();
can.dev.logLevel = 3; QUnit.start();
});
</script>
</body>
@@ -19,7 +19,7 @@ <h2 id="qunit-userAgent"></h2>
QUnit.config.autostart = false;
steal("can/observe").then("can/map/validations", "can/test", "can/map/validations/validations_test.js", function() {
QUnit.start();
can.dev.logLevel = 3; QUnit.start();
});
</script>
</body>
View
@@ -158,11 +158,11 @@ steal('can/util','can/map', 'can/list',function( can ) {
throw new Error('Could not get any raw data while converting using .models');
}
//!steal-remove-start
//!dev-remove-start
if ( ! raw.length ) {
steal.dev.warn("model.js models has no data.")
can.dev.warn("model.js models has no data.")
}
//!steal-remove-end
//!dev-remove-end
if(res.length) {
res.splice(0);
@@ -1577,9 +1577,10 @@ steal('can/util','can/map', 'can/list',function( can ) {
// to remove items on destroyed from Model Lists.
// but there should be a better way.
can.trigger(this,"change",funcName)
//!steal-remove-start
steal.dev.log("Model.js - "+ constructor.shortName+" "+ funcName);
//!steal-remove-end
//!dev-remove-start
can.dev.log("Model.js - "+ constructor.shortName+" "+ funcName);
//!dev-remove-end
// Call event on the instance's Class
can.trigger(constructor,funcName, this);
View
@@ -18,7 +18,7 @@ <h2 id="qunit-userAgent"></h2>
<script type="text/javascript">
QUnit.config.autostart = false;
steal("can/model",'can/map/attributes').then("can/test", "can/util/fixture", "can/model/model_test.js", function() {
QUnit.start();
can.dev.logLevel = 3; QUnit.start();
});
</script>
</body>
View
@@ -18,7 +18,7 @@ <h2 id="qunit-userAgent"></h2>
<script type="text/javascript">
QUnit.config.autostart = false;
steal("can/observe").then("can/test", "can/observe/observe_test.js", function() {
QUnit.start();
can.dev.logLevel = 3; QUnit.start();
});
</script>
</body>
@@ -17,7 +17,7 @@ <h2 id="qunit-userAgent"></h2>
QUnit.config.autostart = false;
steal('can/route/pushstate')
.then("can/test", 'can/route/pushstate/pushstate_test.js', function() {
QUnit.start();
can.dev.logLevel = 3; QUnit.start();
});
</script>
</body>
View
@@ -20,7 +20,7 @@ <h2 id="qunit-userAgent"></h2>
steal("can/route")
.then("can/test")
.then("can/route/route_test.js", function() {
QUnit.start();
can.dev.logLevel = 3; QUnit.start();
});
</script>
</body>
Oops, something went wrong.
ProTip! Use n and p to navigate between commits in a pull request.