Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

updated src to be more readable and gzip better

  • Loading branch information...
commit f44c973eb4fcc0ebdebe4d8fe720b63701a9786a 1 parent 833ad71
@Raynos authored
Showing with 13 additions and 20 deletions.
  1. +1 −0  Makefile
  2. +12 −20 src/pd.js
View
1  Makefile
@@ -6,4 +6,5 @@ test:
--reporter $(REPORTER)
+
.PHONY: test
View
32 src/pd.js
@@ -1,20 +1,12 @@
-"use strict";
-
-var slice = [].slice,
- call = Function.prototype.call,
- getOwnPropertyNames = call.bind(Object.getOwnPropertyNames, Object),
- getOwnPropertyDescriptor =
- call.bind(Object.getOwnPropertyDescriptor, Object),
- create = call.bind(Object.create, Object),
- defineProperty = call.bind(Object.defineProperty, Object);
+var slice = [].slice;
extend(getOwnPropertyDescriptors, {
- bindAll: bindAll,
- extend: extend,
- Name: Name
+ "bindAll": bindAll,
+ "extend": extend,
+ "Name": Name
});
-module.exports = getOwnPropertyDescriptors;
+module["exports"] = getOwnPropertyDescriptors;
/*
pd will return all the own propertydescriptors of the object
@@ -24,7 +16,7 @@ module.exports = getOwnPropertyDescriptors;
@return Object - A hash of key/propertyDescriptors
*/
function getOwnPropertyDescriptors(object) {
- var keys = getOwnPropertyNames(object),
+ var keys = Object.getOwnPropertyNames(object),
returnObj = {};
keys.forEach(getPropertyDescriptor);
@@ -32,7 +24,7 @@ function getOwnPropertyDescriptors(object) {
return returnObj;
function getPropertyDescriptor(key) {
- var pd = getOwnPropertyDescriptor(object, key);
+ var pd = Object.getOwnPropertyDescriptor(object, key);
returnObj[key] = pd;
}
}
@@ -56,11 +48,11 @@ function extend(target) {
return target;
function extendTargetWithProperties(source) {
- getOwnPropertyNames(source).forEach(extendTarget);
+ Object.getOwnPropertyNames(source).forEach(extendTarget);
function extendTarget(key) {
- defineProperty(target, key,
- getOwnPropertyDescriptor(source, key));
+ Object.defineProperty(target, key,
+ Object.getOwnPropertyDescriptor(source, key));
}
}
}
@@ -102,10 +94,10 @@ function bindAll(obj, whitelist) {
@return Object privates
*/
function defineNamespace(object, namespace) {
- var privates = create(object),
+ var privates = Object.create(object),
base = object.valueOf;
- defineProperty(object, 'valueOf', {
+ Object.defineProperty(object, 'valueOf', {
value: valueOf
});
Please sign in to comment.
Something went wrong with that request. Please try again.