aboutsummaryrefslogtreecommitdiffstats
path: root/src/loader.js
diff options
context:
space:
mode:
authorVojta Jina2013-11-14 14:37:53 -0800
committerVojta Jina2013-11-14 15:05:39 -0800
commit8425e9fe383c17f6a5589c778658c5fc0570ae8f (patch)
treee71d091b84d4cc2b1925ab80284d9909657c079c /src/loader.js
parent94764ee08910726db1db7a1101c3001500306dea (diff)
downloadangular.js-8425e9fe383c17f6a5589c778658c5fc0570ae8f.tar.bz2
fix(loader): don't rely on internal APIs
This significantly increases the size of the loader: - minified: 1031bytes -> 1509bytes (+46%) - minified + gzip: 593bytes -> 810bytes (+36%) I'm not entirely sold on the idea of shipping minErr with the loade. With the current state, the angular-loader behavior is completely broken - this is just a quick fix, we can revisit this change in the future. Closes #4437 Closes #4874
Diffstat (limited to 'src/loader.js')
-rw-r--r--src/loader.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/loader.js b/src/loader.js
index 0560595d..b8d50917 100644
--- a/src/loader.js
+++ b/src/loader.js
@@ -11,6 +11,7 @@
function setupModuleLoader(window) {
var $injectorMinErr = minErr('$injector');
+ var ngMinErr = minErr('ng');
function ensure(obj, name, factory) {
return obj[name] || (obj[name] = factory());
@@ -71,6 +72,12 @@ function setupModuleLoader(window) {
* @returns {module} new module with the {@link angular.Module} api.
*/
return function module(name, requires, configFn) {
+ var assertNotHasOwnProperty = function(name, context) {
+ if (name === 'hasOwnProperty') {
+ throw ngMinErr('badname', 'hasOwnProperty is not a valid {0} name', context);
+ }
+ };
+
assertNotHasOwnProperty(name, 'module');
if (requires && modules.hasOwnProperty(name)) {
modules[name] = null;