experimenting with v8-compile-cache -- buggy...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2018-11-29 04:59:50 +03:00
parent 405c6da334
commit 38b43cef81
5 changed files with 42 additions and 0 deletions

View File

@ -6,6 +6,8 @@
* *
**********************************************************************/ **********************************************************************/
//require('v8-compile-cache')
var electron = require('electron') var electron = require('electron')
var app = electron.app var app = electron.app
var BrowserWindow = electron.BrowserWindow var BrowserWindow = electron.BrowserWindow

View File

@ -8,6 +8,8 @@
//var DEBUG = DEBUG != null ? DEBUG : true //var DEBUG = DEBUG != null ? DEBUG : true
//require('v8-compile-cache')
require('./cfg/requirejs') require('./cfg/requirejs')
nodeRequire = nodeRequire =

View File

@ -25,6 +25,29 @@ var util = require('lib/util')
/*********************************************************************/
// XXX a Set-like back-end...
// API:
// .has(..)
// -> bool
//
// Unite two sets...
// .unite(..)
// -> new
//
// Intersection of two sets...
// .intersect(..)
// -> new
//
// Difference of two sets...
// .subtract(..)
// -> new
// extend Set to support the needed basics...
/*********************************************************************/ /*********************************************************************/
var TagsClassPrototype = { var TagsClassPrototype = {

View File

@ -214,6 +214,19 @@ Array.prototype.sortAs = function(other){
} }
// Set set operation shorthands...
Set.prototype.unite = function(other){
return new Set([...this, ...other]) }
Set.prototype.intersect = function(other){
var test = other.has ? 'has' : 'includes'
return new Set([...this]
.filter(function(e){ return other[test](e) })) }
Set.prototype.subtract = function(other){
var test = other.has ? 'has' : 'includes'
return new Set([...this]
.filter(function(e){ return !other[test](e) })) }
module.chainCmp = function(cmp_chain){ module.chainCmp = function(cmp_chain){
return function(a, b, get, data){ return function(a, b, get, data){
var res var res

View File

@ -20,6 +20,8 @@ if((typeof(process) != 'undefined' ? process : {}).__nwjs){
// //
// NOTE: no need to do this in browser... // NOTE: no need to do this in browser...
if(typeof(process) != 'undefined'){ if(typeof(process) != 'undefined'){
//require('v8-compile-cache')
requirejs = requirejs =
global.requirejs = global.requirejs =
window.requirejs = window.requirejs =