deps: Upgrade and move `codepointat` from `static/third` to `npm`

- Remove `codepointat` from `static/third` and fetch it from `npm`.
- Upgrade `codepointat` to 0.2.0.
- Bump up the `PROVISION_VERSION` to 4.1.

Part of #1709.
This commit is contained in:
Rafid Aslam 2017-01-08 13:43:10 +07:00 committed by Tim Abbott
parent 8ac81d2722
commit 911fcd3831
6 changed files with 4 additions and 52 deletions

View File

@ -170,10 +170,6 @@ Files: static/third/marked/*
Copyright: 2011-2013, Christopher Jeffrey
License: Expat
Files: static/third/string-prototype-codepointat/*
Copyright: 2014 Mathias Bynens
License: Expat
Files: static/third/sockjs/sockjs-0.3.4.js
Copyright: 2011-2012 VMware, Inc.
2012 Douglas Crockford

View File

@ -1,5 +1,5 @@
global.assert = require('assert');
require('third/string-prototype-codepointat/codepointat.js');
require('node_modules/string.prototype.codepointat/codepointat.js');
global.Dict = require('js/dict');
global._ = require('third/underscore/underscore.js');

View File

@ -14,6 +14,7 @@
"jquery": "1.12.1",
"jquery-validation": "1.15.1",
"plotly.js": "1.19.2",
"string.prototype.codepointat": "0.2.0",
"webpack": "1.12.2",
"winchan": "0.2.0",
"zxcvbn": "4.4.1"

View File

@ -1,45 +0,0 @@
/*! http://mths.be/codepointat v0.1.0 by @mathias */
if (!String.prototype.codePointAt) {
(function () {
'use strict'; // needed to support `apply`/`call` with `undefined`/`null`
var codePointAt = function (position) {
if (this === null) {
throw TypeError();
}
var string = String(this);
var size = string.length;
// `ToInteger`
var index = position ? Number(position) : 0;
if (isNaN(index)) {
index = 0;
}
// Account for out-of-bounds indices:
if (index < 0 || index >= size) {
return undefined;
}
// Get the first code unit
var first = string.charCodeAt(index);
var second;
if ( // check if its the start of a surrogate pair
first >= 0xD800 && first <= 0xDBFF && // high surrogate
size > index + 1 // there is a next code unit
) {
second = string.charCodeAt(index + 1);
if (second >= 0xDC00 && second <= 0xDFFF) { // low surrogate
// http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;
}
}
return first;
};
if (Object.defineProperty) {
Object.defineProperty(String.prototype, 'codePointAt', {
'value': codePointAt,
'configurable': true,
'writable': true
});
} else {
String.prototype.codePointAt = codePointAt;
}
}());
}

View File

@ -1,2 +1,2 @@
ZULIP_VERSION = "1.4.1+git"
PROVISION_VERSION = '4.0'
PROVISION_VERSION = '4.1'

View File

@ -767,8 +767,8 @@ JS_SPECS = {
'third/jquery-perfect-scrollbar/js/perfect-scrollbar.js',
'third/lazyload/lazyload.js',
'third/spectrum/spectrum.js',
'third/string-prototype-codepointat/codepointat.js',
'third/sockjs/sockjs-0.3.4.js',
'node_modules/string.prototype.codepointat/codepointat.js',
'node_modules/winchan/winchan.js',
'third/handlebars/handlebars.runtime.js',
'third/marked/lib/marked.js',