Skip to content

Commit

Permalink
Update identifier data to Unicode v10
Browse files Browse the repository at this point in the history
  • Loading branch information
mathiasbynens authored and marijnh committed Feb 22, 2018
1 parent dfe1e9a commit ba939ea
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
8 changes: 5 additions & 3 deletions bin/generate-identifier-regex.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
'use strict';

// Which Unicode version should be used?
var version = '9.0.0';
var pkg = require('../package.json');
var dependencies = Object.keys(pkg.devDependencies);
var unicodeVersion = dependencies.find((name) => /^unicode-\d/.test(name));

var start = require('unicode-' + version + '/Binary_Property/ID_Start/code-points.js')
var start = require(unicodeVersion + '/Binary_Property/ID_Start/code-points.js')
.filter(function(ch) { return ch > 0x7f; });
var last = -1;
var cont = [0x200c, 0x200d].concat(require('unicode-' + version + '/Binary_Property/ID_Continue/code-points.js')
var cont = [0x200c, 0x200d].concat(require(unicodeVersion + '/Binary_Property/ID_Continue/code-points.js')
.filter(function(ch) { return ch > 0x7f && search(start, ch, last + 1) == -1; }));

function search(arr, ch, starting) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@
"rollup-plugin-buble": "^0.16.0",
"test262": "git+https://github.com/tc39/test262.git#18c1e799a01cc976695983b61e225ce7959bdd91",
"test262-parser-runner": "^0.3.1",
"unicode-9.0.0": "^0.7.0"
"unicode-10.0.0": "^0.7.5"
}
}
8 changes: 4 additions & 4 deletions src/identifier.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ba939ea

Please sign in to comment.