Permalink
Browse files

Patch some Date Builtins bugs

  • Loading branch information...
awwright committed Sep 29, 2012
1 parent 57cebb8 commit 42be09e045fe306fc947da38335d7bf6c2b3f70e
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/Builtins.js
View
@@ -12,6 +12,9 @@ function prop(p,l) {
if(p.indexOf(':') == -1) p = env.resolve(p,l)||p;
return p;
};
+function pad(v,l){
+ return ('0000'+v).substr(-(l||2));
+}
var env = exports.environment = String.prototype.profile = new RDFEnvironment;
@@ -180,7 +183,6 @@ var StringProperties = {
exports.setStringProperties = function(o){
Object.defineProperties(o, StringProperties);
}
-exports.setStringProperties(String.prototype);
// Array
var ArrayProperties = {
@@ -232,7 +234,7 @@ var DateProperties = {
toCanonical: _( function() { return this.n3() } )
}
exports.setDateProperties = function(o){
- Object.defineProperties(Date.prototype, o);
+ Object.defineProperties(o, DateProperties);
}
// Number

0 comments on commit 42be09e

Please sign in to comment.