try { if (opts.async) { // Have to use generated function for this, since in envs without support, // it breaks in parsing try { ctor = (newFunction('return (async function(){}).constructor;'))(); } catch (e) { if (e instanceofSyntaxError) { thrownewError('This environment does not support async/await'); } else { throw e; } } } else { ctor = Function; } /*************************************************** 利用src构造函数 ***************************************************/ fn = newctor(opts.localsName + ', escapeFn, include, rethrow', src); } catch (e) { // istanbul ignore else if (e instanceofSyntaxError) { if (opts.filename) { e.message += ' in ' + opts.filename; } e.message += ' while compiling ejs\n\n'; e.message += 'If the above error is not helpful, you may want to try EJS-Lint:\n'; e.message += 'https://github.com/RyanZim/EJS-Lint'; if (!opts.async) { e.message += '\n'; e.message += 'Or, if you meant to create an async function, pass `async: true` as an option.'; } } throw e; }
// Return a callable function which will execute the function // created by the source-code, with the passed data as locals // Adds a local `include` function which allows full recursive include var returnedFn = opts.client ? fn : functionanonymous(data) { var include = function(path, includeData) { var d = utils.shallowCopy(utils.createNullProtoObjWherePossible(), data); if (includeData) { d = utils.shallowCopy(d, includeData); } returnincludeFile(path, opts)(d); }; return fn.apply(opts.context, [data || utils.createNullProtoObjWherePossible(), escapeFn, include, rethrow]); }; if (opts.filename && typeofObject.defineProperty === 'function') { var filename = opts.filename; var basename = path.basename(filename, path.extname(filename)); try { Object.defineProperty(returnedFn, 'name', { value: basename, writable: false, enumerable: false, configurable: true }); } catch (e) { /* ignore */ } } return returnedFn; }
//now save the new identity: if (isRememberMe(token)) { rememberIdentity(subject, token, info); } else { if (log.isDebugEnabled()) { log.debug("AuthenticationToken did not indicate RememberMe is requested. " + "RememberMe functionality will not be executed for corresponding account."); } } }
<projectxmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <artifactId>spring-data-web-projection</artifactId> <name>Spring Data - JSON and XML projection web example</name> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency>
if (classCount > 1) { _auxClasses = newHashMap<>(); }
for (inti=0; i < classCount; i++) { _class[i] = loader.defineClass(_bytecodes[i]); finalClasssuperClass= _class[i].getSuperclass();
// Check if this is the main class if (superClass.getName().equals(ABSTRACT_TRANSLET)) { _transletIndex = i; } else { _auxClasses.put(_class[i].getName(), _class[i]); } }
private Translet getTransletInstance() throws TransformerConfigurationException { try { if (_name == null) returnnull; if (_class == null) defineTransletClasses();
// The translet needs to keep a reference to all its auxiliary // class to prevent the GC from collecting them AbstractTranslettranslet= (AbstractTranslet) _class[_transletIndex].newInstance(); translet.postInitialization(); translet.setTemplates(this); translet.setServicesMechnism(_useServicesMechanism); translet.setAllowedProtocols(_accessExternalStylesheet); if (_auxClasses != null) { translet.setAuxiliaryClasses(_auxClasses); }
publicclassTransformedMapextendsAbstractInputCheckedMapDecoratorimplementsSerializable { /** The transformer to use for the key */ protectedfinal Transformer keyTransformer; /** The transformer to use for the value */ protectedfinal Transformer valueTransformer;