Skip to content

Commit

Permalink
Merge pull request #37 from canjs/dont-import-everything
Browse files Browse the repository at this point in the history
not importing all of can-util
  • Loading branch information
phillipskevin authored Jan 30, 2018
2 parents e7dfe57 + 00f2e6f commit 7d32411
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ node_modules
doc/
dist/
.idea/
package-lock.json
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
7 changes: 4 additions & 3 deletions can-construct-super.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/* global require, module */
var can = require('can-util');
var canIsFunction = require('can-util/js/is-function/is-function');
var canEach = require('can-util/js/each/each');
var Construct = require('can-construct');
var hasOwnProperty = Object.prototype.hasOwnProperty;
// tests if we can get super in .toString()
var isFunction = can.isFunction,
var isFunction = canIsFunction,
fnTest = /xyz/.test(function () {
return this.xyz;
}) ? /\b_super\b/ : /.*/,
Expand Down Expand Up @@ -45,7 +46,7 @@ var isFunction = can.isFunction,
Construct._defineProperty = function(addTo, base, name, descriptor) {
var _super = Object.getOwnPropertyDescriptor(base, name);
if(_super) {
can.each(getset, function (method) {
canEach(getset, function (method) {
if(isFunction(_super[method]) && isFunction(descriptor[method])) {
descriptor[method] = getSuper(_super, method, descriptor[method]);
} else if(!isFunction(descriptor[method])) {
Expand Down

0 comments on commit 7d32411

Please sign in to comment.