Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
ensureUniforms(uniforms) {
if (!uniforms) {
return;
}
var vs = strip(this.computed_vertex_source);
var fs = strip(this.computed_fragment_source);
var inject, vs_injections = [], fs_injections = [];
// Check for missing uniform definitions
for (var name in uniforms) {
let vs_defined = GLSL.isUniformDefined(name, vs); // check vertex shader
let fs_defined = GLSL.isUniformDefined(name, fs); // check fragment shader
if (!vs_defined || !fs_defined) {
inject = GLSL.defineUniform(name, uniforms[name]);
if (!inject) {
continue;
}
if (!vs_defined) {
log('trace', `Program ${this.name}: ${name} not defined in vertex shader, injecting: '${inject}'`);
vs_injections.push(inject);
ensureUniforms(uniforms) {
if (!uniforms) {
return;
}
var vs = strip(this.computed_vertex_source);
var fs = strip(this.computed_fragment_source);
var inject, vs_injections = [], fs_injections = [];
// Check for missing uniform definitions
for (var name in uniforms) {
let vs_defined = GLSL.isUniformDefined(name, vs); // check vertex shader
let fs_defined = GLSL.isUniformDefined(name, fs); // check fragment shader
if (!vs_defined || !fs_defined) {
inject = GLSL.defineUniform(name, uniforms[name]);
if (!inject) {
continue;
}
if (!vs_defined) {
log('trace', `Program ${this.name}: ${name} not defined in vertex shader, injecting: '${inject}'`);
export async function getFileByOrder (...files) {
for (let file of files) {
if (await pathExists(file)) {
let data = {
name: file,
value: stripComments(await fs.readFile(file, 'utf8'))
}
return data
}
}
log('Could not find Makefile in current directory!'.red)
process.exit()
}
constructor(source, config = {}) {
if (config.reverseOctave) {
source = reverseOctave(source);
}
let MMLIteratorClass = config.MMLIterator || MMLIterator;
let tracks = stripComments(source).split(";");
tracks = tracks.filter(source => !!source.trim());
tracks = tracks.map(track => new MMLIteratorClass(track, config));
super(tracks, config);
}
}
const rs = source.split('\n').map(function (line) {
line = line.replace(/^\s+|\s+$/g, '')
try {
line = stripComments.line(line)
} catch (e) {
}
return line
}).join('\n')
return rs
function css2js(code) {
return strip
.block(code)
.replace(/\n|\r/g, '')
.replace(/\\/g, '\\\\')
.replace(/'/g, '"');
}