Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

reduce to only code that is under my copyright control

  • Loading branch information...
commit ef416a4caf332b0dd9956625942ce10282d85075 1 parent 5be59ee
@petermichaux authored
View
9 README
@@ -19,15 +19,6 @@ as the third argument to the iterators which is incorrect.
It is a trade-off and one is not better but this is why
I've chosen not to include the string splitting trick.
-For JSON polyfills use Douglas Crockford's json2.js
-
-https://github.com/douglascrockford/JSON-js
-
-JSON.parse
-JSON.stringify
-Date.prototype.toJSON
-
-
----------------
TESTS
View
33 src/date.js
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 2012, Peter Michaux, http://peter.michaux.ca/
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-if (!Date.now) {
-
- Date.now = function now() {
- return (new Date()).getTime();
- };
-
-}
View
34 src/string.js
@@ -1,34 +0,0 @@
-/*
- Copyright (c) 2009, 280 North Inc. http://280north.com/
- MIT License. http://github.com/280north/narwhal/blob/master/README.md
-*/
-
-/*
- Modifications by Peter Michaux to check for this object that
- is undefined or null as required by the ECMAScript 5 specification.
-*/
-
-(function() {
-
- var ws = "\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003" +
- "\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028" +
- "\u2029\uFEFF";
-
- if (!String.prototype.trim) {
-
- // http://blog.stevenlevithan.com/archives/faster-trim-javascript
- // http://perfectionkills.com/whitespace-deviations/
- ws = "[" + ws + "]";
- var trimBeginRegexp = new RegExp("^" + ws + ws + "*"),
- trimEndRegexp = new RegExp(ws + ws + "*$");
-
- String.prototype.trim = function trim() {
- if (this === undefined || this === null) {
- throw new TypeError("can't convert "+this+" to object");
- }
- return String(this).replace(trimBeginRegexp, "").replace(trimEndRegexp, "");
- };
-
- }
-
-}());
View
8 tst/nowSuite.js
@@ -1,8 +0,0 @@
-var nowSuite = {
- suiteName: 'nowSuite',
-
- testBasics: function () {
- jsUnity.assertIdentical('number', typeof Date.now());
- }
-
-};
View
10 tst/runner.html
@@ -54,14 +54,10 @@
delete Array.prototype.some;
delete Array.prototype.reduce;
delete Array.prototype.reduceRight;
- delete Date.now;
- delete String.prototype.trim;
</script>
<!-- load the source code to be tested -->
<script src="../src/array.js"></script>
- <script src="../src/date.js"></script>
- <script src="../src/string.js"></script>
<!-- load the test suites to be run -->
<script src="indexOfSuite.js" ></script>
@@ -73,8 +69,6 @@
<script src="someSuite.js" ></script>
<script src="reduceSuite.js" ></script>
<script src="reduceRightSuite.js"></script>
- <script src="nowSuite.js" ></script>
- <script src="trimSuite.js" ></script>
</head>
<body>
@@ -91,9 +85,7 @@
mapSuite,
someSuite,
reduceSuite,
- reduceRightSuite,
- nowSuite,
- trimSuite);
+ reduceRightSuite);
</script>
View
8 tst/trimSuite.js
@@ -1,8 +0,0 @@
-var trimSuite = {
- suiteName: 'trimSuite',
-
- testBasics: function () {
- jsUnity.assertIdentical('a', ' \v \n\r a \t '.trim());
- }
-
-};
Please sign in to comment.
Something went wrong with that request. Please try again.