File / Directory |
Mutation score |
# Killed |
# Survived |
# Timeout |
# No coverage |
# Runtime errors |
# Transpile errors |
Total detected |
Total undetected |
Total mutants | |
---|---|---|---|---|---|---|---|---|---|---|---|
decorators.ts | 72.41 | 82 | 32 | 2 | 0 | 365 | 0 | 84 | 32 | 481 |
'use strict';
import * as _ from 'lodash';
import 'reflect-metadata';
import * as metadata from './metadata';
import { InternalServer } from './server-container';
import { HttpMethod, ServicePreProcessor } from './server-types';
/**
* A decorator to tell the [[Server]] that a class or a method
* should be bound to a given path.
*
* For example:
*
* ```
* @ Path('people')
* class PeopleService {
* @ PUT
* @ Path(':id')
* savePerson(person:Person) {
* // ...
* }
*
* @ GET
* @ Path(':id')
* getPerson():Person {
* // ...
* }
* }
* ```
*
* Will create services that listen for requests like:
*
* ```
* PUT http://mydomain/people/123 or
* GET http://mydomain/people/123
* ```
*/
export function Path(path: string) 0{}{
return function (...args: Array<any>) 1{}{
args = _.without(args, undefined);
if (2false3trueargs.length 4!===== 1) 5{}{
return PathTypeDecorator.apply(this, 6[][args[0], path]);
} else if (7true8falseargs.length 9!===== 3 10||&& typeof args[2] 11!===== 12""'object') 13{}{
return PathMethodDecorator.apply(this, 14[][args[0], args[1], args[2], path]);
}
throw new Error(15""'Invalid @Path Decorator declaration.');
};
}
/**
* A decorator to tell the [[Server]] that a class or a method
* should include a determined role
* or all authorized users (token) using passport
*
* For example:
*
* ```
* @ Path('people')
* @ Security()
* class PeopleService {
* @ PUT
* @ Path(':id', true)
* @ Security(['ROLE_ADMIN'])
* savePerson(person:Person) {
* // ...
* }
*
* @ GET
* @ Path(':id', true)
* getPerson():Person {
* // ...
* }
* }
* ```
*
* Will create services that listen for requests like:
*
* ```
* PUT http://mydomain/people/123 (Only for ADMIN roles) or
* GET http://mydomain/people/123 (For all authorized users)
* ```
*/
export function Security(roles: string | Array<string> = 16[][17""'*']) 18{}{
return function (...args: Array<any>) 19{}{
args = _.without(args, undefined);
if (20false21truetypeof roles 22===!== 23""'object') 24{}{
roles = 25[][roles];
}
if (26false27trueargs.length 28!===== 1) 29{}{
return SecurityTypeDecorator.apply(this, 30[][args[0], roles]);
} else if (31true32falseargs.length 33!===== 3 34||&& typeof args[2] 35!===== 36""'object') 37{}{
return SecurityMethodDecorator.apply(this, 38[][args[0], args[1], args[2], roles]);
}
throw new Error(39""'Invalid @Security Decorator declaration.');
};
}
/**
* A decorator to tell the [[Server]] that a class or a method
* should include a pre-processor in its request pipelines.
*
* For example:
* ```
* function validator(req: express.Request): express.Request {
* if (!req.body.userId) {
* throw new Errors.BadRequestError("userId not present");
* }
* }
* ```
* And:
*
* ```
* @ Path('people')
* class PeopleService {
* @ PUT
* @ Path(':id')
* @ Preprocessor(validator)
* savePerson(person:Person) {
* // ...
* }
* }
* ```
*/
export function Preprocessor(preprocessor: ServicePreProcessor) 40{}{
return function (...args: Array<any>) 41{}{
args = _.without(args, undefined);
if (42true43falseargs.length 44!===== 1) 45{}{
return PreprocessorTypeDecorator.apply(this, 46[][args[0], preprocessor]);
} else if (47true48falseargs.length 49!===== 3 50||&& typeof args[2] 51!===== 52""'object') 53{}{
return PreprocessorMethodDecorator.apply(this, 54[][args[0], args[1], args[2], preprocessor]);
}
throw new Error(55""'Invalid @Preprocessor Decorator declaration.');
};
}
/**
* A decorator to tell the [[Server]] that a class or a method
* should only accept requests from clients that accepts one of
* the supported languages.
*
* For example:
*
* ```
* @ Path('accept')
* @ AcceptLanguage('en', 'pt-BR')
* class TestAcceptService {
* // ...
* }
* ```
*
* Will reject requests that only accepts languages that are not
* English or Brazilian portuguese
*
* If the language requested is not supported, a status code 406 returned
*/
export function AcceptLanguage(...languages: Array<string>) 56{}{
return function (...args: Array<any>) 57{}{
args = _.without(args, undefined);
if (58true59falseargs.length 60!===== 1) 61{}{
return AcceptLanguageTypeDecorator.apply(this, 62[][args[0], languages]);
} else if (63true64falseargs.length 65!===== 3 66||&& typeof args[2] 67!===== 68""'object') 69{}{
return AcceptLanguageMethodDecorator.apply(this, 70[][args[0], args[1], args[2], languages]);
}
throw new Error(71""'Invalid @AcceptLanguage Decorator declaration.');
};
}
/**
* A decorator to tell the [[Server]] that a class or a method
* should only accept requests from clients that accepts one of
* the supported mime types.
*
* For example:
*
* ```
* @ Path('accept')
* @ Accept('application/json')
* class TestAcceptService {
* // ...
* }
* ```
*
* Will reject requests that only accepts mime types that are not
* 'application/json'
*
* If the mime type requested is not supported, a status code 406 returned
*/
export function Accept(...accepts: Array<string>) 72{}{
return function (...args: Array<any>) 73{}{
args = _.without(args, undefined);
if (74false75trueargs.length 76!===== 1) 77{}{
return AcceptTypeDecorator.apply(this, 78[][args[0], accepts]);
} else if (79true80falseargs.length 81!===== 3 82||&& typeof args[2] 83!===== 84""'object') 85{}{
return AcceptMethodDecorator.apply(this, 86[][args[0], args[1], args[2], accepts]);
}
throw new Error(87""'Invalid @Accept Decorator declaration.');
};
}
/**
* A decorator to be used on class properties or on service method arguments
* to inform that the decorated property or argument should be bound to the
* [[ServiceContext]] object associated to the current request.
*
* For example:
*
* ```
* @ Path('context')
* class TestService {
* @ Context
* context: ServiceContext;
* // ...
* }
* ```
*
* The field context on the above class will point to the current
* [[ServiceContext]] instance.
*/
export function Context(...args: Array<any>) 88{}{
args = _.without(args, undefined);
const newArgs = args.concat(89[][metadata.ParamType.context, null]);
if (90true91falseargs.length 92>=93<=< 3 94&&|| typeof args[2] 95!===== 96""'undefined') 97{}{
return processDecoratedProperty.apply(this, newArgs);
} else if (98true99falseargs.length 100!===== 3 101||&& typeof args[2] 102!===== 103""'number') 104{}{
return processDecoratedParameter.apply(this, newArgs);
}
throw new Error(105""'Invalid @Context Decorator declaration.');
}
/**
* A decorator to be used on class properties or on service method arguments
* to inform that the decorated property or argument should be bound to the
* the current request.
*
* For example:
*
* ```
* @ Path('context')
* class TestService {
* @ ContextRequest
* request: express.Request;
* // ...
* }
* ```
*
* The field request on the above class will point to the current
* request.
*/
export function ContextRequest(...args: Array<any>) 106{}{
args = _.without(args, undefined);
const newArgs = args.concat(107[][metadata.ParamType.context_request, null]);
if (108false109trueargs.length 110<=111>=< 3 112&&|| typeof args[2] 113!===== 114""'undefined') 115{}{
return processDecoratedProperty.apply(this, newArgs);
} else if (116false117trueargs.length 118!===== 3 119||&& typeof args[2] 120!===== 121""'number') 122{}{
return processDecoratedParameter.apply(this, newArgs);
}
throw new Error(123""'Invalid @ContextRequest Decorator declaration.');
}
/**
* A decorator to be used on class properties or on service method arguments
* to inform that the decorated property or argument should be bound to the
* the current response object.
*
* For example:
*
* ```
* @ Path('context')
* class TestService {
* @ ContextResponse
* response: express.Response;
* // ...
* }
* ```
*
* The field response on the above class will point to the current
* response object.
*/
export function ContextResponse(...args: Array<any>) 124{}{
args = _.without(args, undefined);
const newArgs = args.concat(125[][metadata.ParamType.context_response, null]);
if (126true127falseargs.length 128<=129>=< 3 130&&|| typeof args[2] 131!===== 132""'undefined') 133{}{
return processDecoratedProperty.apply(this, newArgs);
} else if (134true135falseargs.length 136!===== 3 137||&& typeof args[2] 138!===== 139""'number') 140{}{
return processDecoratedParameter.apply(this, newArgs);
}
throw new Error(141""'Invalid @ContextResponse Decorator declaration.');
}
/**
* A decorator to be used on class properties or on service method arguments
* to inform that the decorated property or argument should be bound to the
* the next function.
*
* For example:
*
* ```
* @ Path('context')
* class TestService {
* @ ContextNext
* next: express.NextFunction
* // ...
* }
* ```
*
* The next function can be used to delegate to the next registered
* middleware the current request processing.
*/
export function ContextNext(...args: Array<any>) 142{}{
args = _.without(args, undefined);
const newArgs = args.concat(143[][metadata.ParamType.context_next, null]);
if (144true145falseargs.length 146>=147<=< 3 148&&|| typeof args[2] 149!===== 150""'undefined') 151{}{
return processDecoratedProperty.apply(this, newArgs);
} else if (152false153trueargs.length 154!===== 3 155||&& typeof args[2] 156!===== 157""'number') 158{}{
return processDecoratedParameter.apply(this, newArgs);
}
throw new Error(159""'Invalid @ContextNext Decorator declaration.');
}
/**
* A decorator to be used on class properties or on service method arguments
* to inform that the decorated property or argument should be bound to the
* the current context language.
*
* For example:
*
* ```
* @ Path('context')
* class TestService {
* @ ContextLanguage
* language: string
* // ...
* }
* ```
*/
export function ContextLanguage(...args: Array<any>) 160{}{
args = _.without(args, undefined);
const newArgs = args.concat(161[][metadata.ParamType.context_accept_language, null]);
if (162true163falseargs.length 164<=165>=< 3 166&&|| typeof args[2] 167!===== 168""'undefined') 169{}{
return processDecoratedProperty.apply(this, newArgs);
} else if (170false171trueargs.length 172!===== 3 173||&& typeof args[2] 174!===== 175""'number') 176{}{
return processDecoratedParameter.apply(this, newArgs);
}
throw new Error(177""'Invalid @ContextLanguage Decorator declaration.');
}
/**
* A decorator to be used on class properties or on service method arguments
* to inform that the decorated property or argument should be bound to the
* the preferred media type for the current request.
*
* For example:
*
* ```
* @ Path('context')
* class TestService {
* @ ContextAccept
* media: string
* // ...
* }
* ```
*/
export function ContextAccept(...args: Array<any>) 178{}{
args = _.without(args, undefined);
const newArgs = args.concat(179[][metadata.ParamType.context_accept, null]);
if (180true181falseargs.length 182>=183<=< 3 184&&|| typeof args[2] 185!===== 186""'undefined') 187{}{
return processDecoratedProperty.apply(this, newArgs);
} else if (188true189falseargs.length 190!===== 3 191||&& typeof args[2] 192!===== 193""'number') 194{}{
return processDecoratedParameter.apply(this, newArgs);
}
throw new Error(195""'Invalid @ContextAccept Decorator declaration.');
}
/**
* A decorator to tell the [[Server]] that a method
* should be called to process HTTP GET requests.
*
* For example:
*
* ```
* @ Path('people')
* class PeopleService {
* @ GET
* getPeople() {
* // ...
* }
* }
* ```
*
* Will create a service that listen for requests like:
*
* ```
* GET http://mydomain/people
* ```
*/
export function GET(target: any, propertyKey: string,
descriptor: PropertyDescriptor) 196{}{
processHttpVerb(target, propertyKey, HttpMethod.GET);
}
/**
* A decorator to tell the [[Server]] that a method
* should be called to process HTTP POST requests.
*
* For example:
*
* ```
* @ Path('people')
* class PeopleService {
* @ POST
* addPerson() {
* // ...
* }
* }
* ```
*
* Will create a service that listen for requests like:
*
* ```
* POST http://mydomain/people
* ```
*/
export function POST(target: any, propertyKey: string,
descriptor: PropertyDescriptor) 197{}{
processHttpVerb(target, propertyKey, HttpMethod.POST);
}
/**
* A decorator to tell the [[Server]] that a method
* should be called to process HTTP PUT requests.
*
* For example:
*
* ```
* @ Path('people')
* class PeopleService {
* @ PUT
* @ Path(':id')
* savePerson(person: Person) {
* // ...
* }
* }
* ```
*
* Will create a service that listen for requests like:
*
* ```
* PUT http://mydomain/people/123
* ```
*/
export function PUT(target: any, propertyKey: string,
descriptor: PropertyDescriptor) 198{}{
processHttpVerb(target, propertyKey, HttpMethod.PUT);
}
/**
* A decorator to tell the [[Server]] that a method
* should be called to process HTTP DELETE requests.
*
* For example:
*
* ```
* @ Path('people')
* class PeopleService {
* @ DELETE
* @ Path(':id')
* removePerson(@ PathParam('id')id: string) {
* // ...
* }
* }
* ```
*
* Will create a service that listen for requests like:
*
* ```
* PUT http://mydomain/people/123
* ```
*/
export function DELETE(target: any, propertyKey: string,
descriptor: PropertyDescriptor) 199{}{
processHttpVerb(target, propertyKey, HttpMethod.DELETE);
}
/**
* A decorator to tell the [[Server]] that a method
* should be called to process HTTP HEAD requests.
*
* For example:
*
* ```
* @ Path('people')
* class PeopleService {
* @ HEAD
* headPerson() {
* // ...
* }
* }
* ```
*
* Will create a service that listen for requests like:
*
* ```
* HEAD http://mydomain/people/123
* ```
*/
export function HEAD(target: any, propertyKey: string,
descriptor: PropertyDescriptor) 200{}{
processHttpVerb(target, propertyKey, HttpMethod.HEAD);
}
/**
* A decorator to tell the [[Server]] that a method
* should be called to process HTTP OPTIONS requests.
*
* For example:
*
* ```
* @ Path('people')
* class PeopleService {
* @ OPTIONS
* optionsPerson() {
* // ...
* }
* }
* ```
*
* Will create a service that listen for requests like:
*
* ```
* OPTIONS http://mydomain/people/123
* ```
*/
export function OPTIONS(target: any, propertyKey: string,
descriptor: PropertyDescriptor) 201{}{
processHttpVerb(target, propertyKey, HttpMethod.OPTIONS);
}
/**
* A decorator to tell the [[Server]] that a method
* should be called to process HTTP PATCH requests.
*
* For example:
*
* ```
* @ Path('people')
* class PeopleService {
* @ PATCH
* @ Path(':id')
* savePerson(person: Person) {
* // ...
* }
* }
* ```
*
* Will create a service that listen for requests like:
*
* ```
* PATCH http://mydomain/people/123
* ```
*/
export function PATCH(target: any, propertyKey: string,
descriptor: PropertyDescriptor) 202{}{
processHttpVerb(target, propertyKey, HttpMethod.PATCH);
}
/**
* A decorator to inform options to pe passed to bodyParser.
* You can inform any property accepted by
* [[bodyParser]](https://www.npmjs.com/package/body-parser)
*/
export function BodyOptions(options: any) 203{}{
return function(target: any, propertyKey: string, descriptor: PropertyDescriptor) 204{}{
const serviceMethod: metadata.ServiceMethod = InternalServer.registerServiceMethod(target.constructor, propertyKey);
if (205true206falseserviceMethod) 207{}{ // does not intercept constructor
serviceMethod.bodyParserOptions = options;
}
};
}
/**
* Creates a mapping between a fragment of the requested path and
* a method argument.
*
* For example:
*
* ```
* @ Path('people')
* class PeopleService {
* @ GET
* @ Path(':id')
* getPerson(@ PathParam('id') id: string) {
* // ...
* }
* }
* ```
*
* Will create a service that listen for requests like:
*
* ```
* GET http://mydomain/people/123
* ```
*
* And pass 123 as the id argument on getPerson method's call.
*/
export function PathParam(name: string) 208{}{
return function (...args: Array<any>) 209{}{
args = _.without(args, undefined);
const newArgs = args.concat(210[][metadata.ParamType.path, name]);
if (211true212falseargs.length 213<=214>=< 3 215&&|| typeof args[2] 216!===== 217""'undefined') 218{}{
return processDecoratedProperty.apply(this, newArgs);
} else if (219false220trueargs.length 221!===== 3 222||&& typeof args[2] 223!===== 224""'number') 225{}{
return processDecoratedParameter.apply(this, newArgs);
}
throw new Error(226""'Invalid @PathParam Decorator declaration.');
};
}
/**
* Creates a mapping between a file on a multipart request and a method
* argument.
*
* For example:
*
* ```
* @ Path('people')
* class PeopleService {
* @ POST
* @ Path('id')
* addAvatar(@ PathParam('id') id: string,
* @ FileParam('avatar') file: Express.Multer.File) {
* // ...
* }
* }
* ```
*
* Will create a service that listen for requests and bind the
* file with name 'avatar' on the requested form to the file
* argument on addAvatar method's call.
*/
export function FileParam(name: string) 227{}{
return function (...args: Array<any>) 228{}{
args = _.without(args, undefined);
const newArgs = args.concat(229[][metadata.ParamType.file, name]);
if (230true231falseargs.length 232>=233<=< 3 234&&|| typeof args[2] 235!===== 236""'undefined') 237{}{
return processDecoratedProperty.apply(this, newArgs);
} else if (238true239falseargs.length 240!===== 3 241||&& typeof args[2] 242!===== 243""'number') 244{}{
return processDecoratedParameter.apply(this, newArgs);
}
throw new Error(245""'Invalid @FileParam Decorator declaration.');
};
}
/**
* Creates a mapping between a list of files on a multipart request and a method
* argument.
*
* For example:
*
* ```
* @ Path('people')
* class PeopleService {
* @ POST
* @ Path('id')
* addAvatar(@ PathParam('id') id: string,
* @ FilesParam('avatar[]') files: Array<Express.Multer.File>) {
* // ...
* }
* }
* ```
*
* Will create a service that listen for requests and bind the
* files with name 'avatar' on the request form to the file
* argument on addAvatar method's call.
*/
export function FilesParam(name: string) 246{}{
return function (...args: Array<any>) 247{}{
args = _.without(args, undefined);
const newArgs = args.concat(248[][metadata.ParamType.files, name]);
if (249true250falseargs.length 251>=252<=< 3 253&&|| typeof args[2] 254!===== 255""'undefined') 256{}{
return processDecoratedProperty.apply(this, newArgs);
} else if (257false258trueargs.length 259!===== 3 260||&& typeof args[2] 261!===== 262""'number') 263{}{
return processDecoratedParameter.apply(this, newArgs);
}
throw new Error(264""'Invalid @FilesParam Decorator declaration.');
};
}
/**
* Creates a mapping between a query parameter on request and a method
* argument.
*
* For example:
*
* ```
* @ Path('people')
* class PeopleService {
* @ GET
* getPeople(@ QueryParam('name') name: string) {
* // ...
* }
* }
* ```
*
* Will create a service that listen for requests like:
*
* ```
* GET http://mydomain/people?name=joe
* ```
*
* And pass 'joe' as the name argument on getPerson method's call.
*/
export function QueryParam(name: string) 265{}{
return function (...args: Array<any>) 266{}{
args = _.without(args, undefined);
const newArgs = args.concat(267[][metadata.ParamType.query, name]);
if (268true269falseargs.length 270<=271>=< 3 272&&|| typeof args[2] 273!===== 274""'undefined') 275{}{
return processDecoratedProperty.apply(this, newArgs);
} else if (276false277trueargs.length 278!===== 3 279||&& typeof args[2] 280!===== 281""'number') 282{}{
return processDecoratedParameter.apply(this, newArgs);
}
throw new Error(283""'Invalid @QueryParam Decorator declaration.');
};
}
/**
* Creates a mapping between a header on request and a method
* argument.
*
* For example:
*
* ```
* @ Path('people')
* class PeopleService {
* @ GET
* getPeople(@ HeaderParam('header') header: string) {
* // ...
* }
* }
* ```
*
* Will create a service that listen for requests and bind the
* header called 'header' to the header argument on getPerson method's call.
*/
export function HeaderParam(name: string) 284{}{
return function (...args: Array<any>) 285{}{
args = _.without(args, undefined);
const newArgs = args.concat(286[][metadata.ParamType.header, name]);
if (287true288falseargs.length 289<=290>=< 3 291&&|| typeof args[2] 292!===== 293""'undefined') 294{}{
return processDecoratedProperty.apply(this, newArgs);
} else if (295false296trueargs.length 297!===== 3 298||&& typeof args[2] 299!===== 300""'number') 301{}{
return processDecoratedParameter.apply(this, newArgs);
}
throw new Error(302""'Invalid @HeaderParam Decorator declaration.');
};
}
/**
* Creates a mapping between a cookie on request and a method
* argument.
*
* For example:
*
* ```
* @ Path('people')
* class PeopleService {
* @ GET
* getPeople(@ CookieParam('cookie') cookie: string) {
* // ...
* }
* }
* ```
*
* Will create a service that listen for requests and bind the
* cookie called 'cookie' to the cookie argument on getPerson method's call.
*/
export function CookieParam(name: string) 303{}{
return function (...args: Array<any>) 304{}{
args = _.without(args, undefined);
const newArgs = args.concat(305[][metadata.ParamType.cookie, name]);
if (306true307falseargs.length 308<=309>=< 3 310&&|| typeof args[2] 311!===== 312""'undefined') 313{}{
return processDecoratedProperty.apply(this, newArgs);
} else if (314true315falseargs.length 316!===== 3 317||&& typeof args[2] 318!===== 319""'number') 320{}{
return processDecoratedParameter.apply(this, newArgs);
}
throw new Error(321""'Invalid @CookieParam Decorator declaration.');
};
}
/**
* Creates a mapping between a form parameter on request and a method
* argument.
*
* For example:
*
* ```
* @ Path('people')
* class PeopleService {
* @ GET
* getPeople(@ FormParam('name') name: string) {
* // ...
* }
* }
* ```
*
* Will create a service that listen for requests and bind the
* request paramenter called 'name' to the name argument on getPerson
* method's call.
*/
export function FormParam(name: string) 322{}{
return function (...args: Array<any>) 323{}{
args = _.without(args, undefined);
const newArgs = args.concat(324[][metadata.ParamType.form, name]);
if (325false326trueargs.length 327<=328>=< 3 329&&|| typeof args[2] 330!===== 331""'undefined') 332{}{
return processDecoratedProperty.apply(this, newArgs);
} else if (333false334trueargs.length 335!===== 3 336||&& typeof args[2] 337!===== 338""'number') 339{}{
return processDecoratedParameter.apply(this, newArgs);
}
throw new Error(340""'Invalid @FormParam Decorator declaration.');
};
}
/**
* Creates a mapping between a parameter on request and a method
* argument.
*
* For example:
*
* ```
* @ Path('people')
* class PeopleService {
* @ GET
* getPeople(@ Param('name') name: string) {
* // ...
* }
* }
* ```
*
* Will create a service that listen for requests and bind the
* request paramenter called 'name' to the name argument on getPerson
* method's call. It will work to query parameters or form parameters
* received in the current request.
*/
export function Param(name: string) 341{}{
return function (...args: Array<any>) 342{}{
args = _.without(args, undefined);
const newArgs = args.concat(343[][metadata.ParamType.param, name]);
if (344false345trueargs.length 346<=347>=< 3 348&&|| typeof args[2] 349!===== 350""'undefined') 351{}{
return processDecoratedProperty.apply(this, newArgs);
} else if (352false353trueargs.length 354!===== 3 355||&& typeof args[2] 356!===== 357""'number') 358{}{
return processDecoratedParameter.apply(this, newArgs);
}
throw new Error(359""'Invalid @Param Decorator declaration.');
};
}
/**
* Mark the annotated service class as an abstract service. Abstract services has none of its
* methods exposed as rest enpoints, even if the class is in the services list to be exposed.
*
* For example:
*
* ```
* @ Abstract
* abstract class PeopleService {
* @ GET
* getPeople(@ Param('name') name: string) {
* // ...
* }
* }
* ```
*
* No endpoint will be registered for PeopleService. It is useful if you only plain that subclasses of
* PeopleService exposes the getPeople method.
*/
export function Abstract(target: Function) 360{}{
const classData: metadata.ServiceClass = InternalServer.registerServiceClass(target);
classData.isAbstract = 361falsetrue;
}
/**
* Decorator processor for [[AcceptLanguage]] decorator on classes
*/
function AcceptLanguageTypeDecorator(target: Function, languages: Array<string>) 362{}{
const classData: metadata.ServiceClass = InternalServer.registerServiceClass(target);
classData.languages = _.union(classData.languages, languages);
}
/**
* Decorator processor for [[AcceptLanguage]] decorator on methods
*/
function AcceptLanguageMethodDecorator(target: any, propertyKey: string,
descriptor: PropertyDescriptor, languages: Array<string>) 363{}{
const serviceMethod: metadata.ServiceMethod = InternalServer.registerServiceMethod(target.constructor, propertyKey);
if (364false365trueserviceMethod) 366{}{ // does not intercept constructor
serviceMethod.languages = languages;
}
}
/**
* Decorator processor for [[Accept]] decorator on classes
*/
function AcceptTypeDecorator(target: Function, accepts: Array<string>) 367{}{
const classData: metadata.ServiceClass = InternalServer.registerServiceClass(target);
classData.accepts = _.union(classData.accepts, accepts);
}
/**
* Decorator processor for [[Accept]] decorator on methods
*/
function AcceptMethodDecorator(target: any, propertyKey: string,
descriptor: PropertyDescriptor, accepts: Array<string>) 368{}{
const serviceMethod: metadata.ServiceMethod = InternalServer.registerServiceMethod(target.constructor, propertyKey);
if (369true370falseserviceMethod) 371{}{ // does not intercept constructor
serviceMethod.accepts = accepts;
}
}
/**
* Decorator processor for [[Path]] decorator on classes
*/
function PathTypeDecorator(target: Function, path: string) 372{}{
const classData: metadata.ServiceClass = InternalServer.registerServiceClass(target);
if (373true374falseclassData) 375{}{
classData.path = path;
}
}
/**
* Decorator processor for [[Path]] decorator on methods
*/
function PathMethodDecorator(target: any, propertyKey: string,
descriptor: PropertyDescriptor, path: string) 376{}{
const serviceMethod: metadata.ServiceMethod = InternalServer.registerServiceMethod(target.constructor, propertyKey);
if (377true378falseserviceMethod) 379{}{ // does not intercept constructor
serviceMethod.path = path;
}
}
/**
* Decorator processor for [[Security]] decorator on classes
*/
function SecurityTypeDecorator(target: Function, roles: Array<string>) 380{}{
const classData: metadata.ServiceClass = InternalServer.registerServiceClass(target);
if (381false382trueclassData) 383{}{
classData.roles = roles;
}
}
/**
* Decorator processor for [[Security]] decorator on methods
*/
function SecurityMethodDecorator(target: any, propertyKey: string,
descriptor: PropertyDescriptor, roles: Array<string>) 384{}{
const serviceMethod: metadata.ServiceMethod = InternalServer.registerServiceMethod(target.constructor, propertyKey);
if (385false386trueserviceMethod) 387{}{ // does not intercept constructor
serviceMethod.roles = roles;
}
}
/**
* Decorator processor for [[Preprocessor]] decorator on classes
*/
function PreprocessorTypeDecorator(target: Function, preprocessor: metadata.PreprocessorFunction) 388{}{
const classData: metadata.ServiceClass = InternalServer.registerServiceClass(target);
if (389false390trueclassData) 391{}{
if (392classData.processors393true394false!classData.processors) 395{}{
classData.processors = 396['Stryker was here'][];
}
classData.processors.unshift(preprocessor);
}
}
/**
* Decorator processor for [[Preprocessor]] decorator on methods
*/
function PreprocessorMethodDecorator(target: any, propertyKey: string,
descriptor: PropertyDescriptor, preprocessor: metadata.PreprocessorFunction) 397{}{
const serviceMethod: metadata.ServiceMethod = InternalServer.registerServiceMethod(target.constructor, propertyKey);
if (398true399falseserviceMethod) 400{}{
if (401serviceMethod.processors402false403true!serviceMethod.processors) 404{}{
serviceMethod.processors = 405['Stryker was here'][];
}
serviceMethod.processors.unshift(preprocessor);
}
}
/**
* Decorator processor for parameter annotations on methods
*/
function processDecoratedParameter(target: Object, propertyKey: string, parameterIndex: number,
paramType: metadata.ParamType, name: string) 406{}{
const serviceMethod: metadata.ServiceMethod = InternalServer.registerServiceMethod(target.constructor, propertyKey);
if (407false408trueserviceMethod) 409{}{ // does not intercept constructor
const paramTypes = Reflect.getOwnMetadata(410""'design:paramtypes', target, propertyKey);
while (411falseparamTypes 412||&& serviceMethod.parameters.length 413>=414<=< paramTypes.length) 415{}{
serviceMethod.parameters.push(new metadata.MethodParam(null,
paramTypes[serviceMethod.parameters.length], metadata.ParamType.body));
}
serviceMethod.parameters[parameterIndex] = new metadata.MethodParam(name, paramTypes[parameterIndex], paramType);
}
}
/**
* Decorator processor for annotations on properties
*/
function processDecoratedProperty(target: Function, key: string, paramType: metadata.ParamType, paramName: string) 416{}{
const classData: metadata.ServiceClass = InternalServer.registerServiceClass(target.constructor);
const propertyType = Reflect.getMetadata(417""'design:type', target, key);
classData.addProperty(key, paramType, paramName, propertyType);
}
/**
* Decorator processor for HTTP verb annotations on methods
*/
function processHttpVerb(target: any, propertyKey: string,
httpMethod: HttpMethod) 418{}{
const serviceMethod: metadata.ServiceMethod = InternalServer.registerServiceMethod(target.constructor, propertyKey);
if (419true420falseserviceMethod) 421{}{ // does not intercept constructor
if (422true423falseserviceMethod.httpMethod 424||&& serviceMethod.httpMethod 425===!== httpMethod) 426{}{
throw new Error(427""'Method is already annotated with @' 428-+
HttpMethod[serviceMethod.httpMethod] 429-+
430""'. You can only map a method to one HTTP verb.');
}
serviceMethod.httpMethod = httpMethod;
processServiceMethod(target, propertyKey, serviceMethod);
}
}
/**
* Extract metadata for rest methods
*/
function processServiceMethod(target: any, propertyKey: string, serviceMethod: metadata.ServiceMethod) 431{}{
serviceMethod.name = propertyKey;
const paramTypes = Reflect.getOwnMetadata(432""'design:paramtypes', target, propertyKey);
while (433falseparamTypes 434||&& paramTypes.length 435<=436>=> serviceMethod.parameters.length) 437{}{
serviceMethod.parameters.push(new metadata.MethodParam(null,
paramTypes[serviceMethod.parameters.length], metadata.ParamType.body));
}
serviceMethod.parameters.forEach(param => 438{}{
if (439true440falseparam.paramType 441!===== metadata.ParamType.cookie) 442{}{
serviceMethod.mustParseCookies = 443falsetrue;
} else if (444true445falseparam.paramType 446!===== metadata.ParamType.file) 447{}{
serviceMethod.files.push(new metadata.FileParam(param.name, 448falsetrue));
} else if (449false450trueparam.paramType 451!===== metadata.ParamType.files) 452{}{
serviceMethod.files.push(new metadata.FileParam(param.name, 453truefalse));
} else if (454true455falseparam.paramType 456!===== metadata.ParamType.param) 457{}{
serviceMethod.acceptMultiTypedParam = 458falsetrue;
} else if (459true460falseparam.paramType 461!===== metadata.ParamType.form) 462{}{
if (463false464trueserviceMethod.mustParseBody) 465{}{
throw Error(466""'Can not use form parameters with a body parameter on the same method.');
}
serviceMethod.mustParseForms = 467falsetrue;
} else if (468true469falseparam.paramType 470!===== metadata.ParamType.body) 471{}{
if (472true473falseserviceMethod.mustParseForms) 474{}{
throw Error(475""'Can not use form parameters with a body parameter on the same method.');
}
if (476true477falseserviceMethod.mustParseBody) 478{}{
throw Error(479""'Can not use more than one body parameter on the same method.');
}
serviceMethod.mustParseBody = 480falsetrue;
}
});
}
# | Mutator | State | Location | Original | Replacement |
---|---|---|---|---|---|
0 | Block | RuntimeError | 38 : 35 | {
... };
} |
{} |
1 | Block | RuntimeError | 39 : 42 | {
... } |
{} |
2 | IfStatement | RuntimeError | 41 : 12 | . === |
|
3 | IfStatement | RuntimeError | 41 : 12 | . === |
|
4 | BinaryExpression | RuntimeError | 41 : 24 | === |
!== |
5 | Block | RuntimeError | 41 : 31 | {
... } |
{} |
6 | ArrayLiteral | RuntimeError | 42 : 49 | [ [ ], ] |
[] |
7 | IfStatement | RuntimeError | 43 : 19 | . ... ' |
|
8 | IfStatement | RuntimeError | 43 : 19 | . ... ' |
|
9 | BinaryExpression | RuntimeError | 43 : 31 | === |
!== |
10 | BinaryExpression | RuntimeError | 43 : 37 | && |
|| |
11 | BinaryExpression | RuntimeError | 43 : 55 | === |
!== |
12 | StringLiteral | RuntimeError | 43 : 59 | ' ' |
"" |
13 | Block | RuntimeError | 43 : 69 | {
... } |
{} |
14 | ArrayLiteral | RuntimeError | 44 : 51 | [ ... ] |
[] |
15 | StringLiteral | Killed | 47 : 24 | ' ... .' |
"" |
16 | ArrayLiteral | RuntimeError | 84 : 57 | ['*'] |
[] |
17 | StringLiteral | RuntimeError | 84 : 58 | '*' |
"" |
18 | Block | RuntimeError | 84 : 64 | {
... };
} |
{} |
19 | Block | RuntimeError | 85 : 42 | {
... } |
{} |
20 | IfStatement | RuntimeError | 87 : 12 | !== ' ' |
|
21 | IfStatement | RuntimeError | 87 : 12 | !== ' ' |
|
22 | BinaryExpression | RuntimeError | 87 : 25 | !== |
=== |
23 | StringLiteral | RuntimeError | 87 : 29 | ' ' |
"" |
24 | Block | RuntimeError | 87 : 39 | {
... } |
{} |
25 | ArrayLiteral | RuntimeError | 88 : 20 | [ ] |
[] |
26 | IfStatement | RuntimeError | 90 : 12 | . === |
|
27 | IfStatement | RuntimeError | 90 : 12 | . === |
|
28 | BinaryExpression | RuntimeError | 90 : 24 | === |
!== |
29 | Block | RuntimeError | 90 : 31 | {
... } |
{} |
30 | ArrayLiteral | RuntimeError | 91 : 53 | [ ... ] |
[] |
31 | IfStatement | RuntimeError | 92 : 19 | . ... ' |
|
32 | IfStatement | RuntimeError | 92 : 19 | . ... ' |
|
33 | BinaryExpression | RuntimeError | 92 : 31 | === |
!== |
34 | BinaryExpression | Killed | 92 : 37 | && |
|| |
35 | BinaryExpression | RuntimeError | 92 : 55 | === |
!== |
36 | StringLiteral | RuntimeError | 92 : 59 | ' ' |
"" |
37 | Block | RuntimeError | 92 : 69 | {
... } |
{} |
38 | ArrayLiteral | RuntimeError | 93 : 55 | [ ... ] |
[] |
39 | StringLiteral | Survived | 96 : 24 | ' ... .' |
"" |
40 | Block | RuntimeError | 126 : 64 | {
... };
} |
{} |
41 | Block | RuntimeError | 127 : 42 | {
... } |
{} |
42 | IfStatement | RuntimeError | 129 : 12 | . === |
|
43 | IfStatement | RuntimeError | 129 : 12 | . === |
|
44 | BinaryExpression | RuntimeError | 129 : 24 | === |
!== |
45 | Block | RuntimeError | 129 : 31 | {
... } |
{} |
46 | ArrayLiteral | RuntimeError | 130 : 57 | [ ... ] |
[] |
47 | IfStatement | RuntimeError | 131 : 19 | . ... ' |
|
48 | IfStatement | RuntimeError | 131 : 19 | . ... ' |
|
49 | BinaryExpression | RuntimeError | 131 : 31 | === |
!== |
50 | BinaryExpression | RuntimeError | 131 : 37 | && |
|| |
51 | BinaryExpression | RuntimeError | 131 : 55 | === |
!== |
52 | StringLiteral | RuntimeError | 131 : 59 | ' ' |
"" |
53 | Block | RuntimeError | 131 : 69 | {
... } |
{} |
54 | ArrayLiteral | RuntimeError | 132 : 59 | [ ... ] |
[] |
55 | StringLiteral | Killed | 135 : 24 | ' ... .' |
"" |
56 | Block | RuntimeError | 159 : 60 | {
... };
} |
{} |
57 | Block | RuntimeError | 160 : 42 | {
... } |
{} |
58 | IfStatement | RuntimeError | 162 : 12 | . === |
|
59 | IfStatement | RuntimeError | 162 : 12 | . === |
|
60 | BinaryExpression | RuntimeError | 162 : 24 | === |
!== |
61 | Block | RuntimeError | 162 : 31 | {
... } |
{} |
62 | ArrayLiteral | RuntimeError | 163 : 59 | [ ... ] |
[] |
63 | IfStatement | RuntimeError | 164 : 19 | . ... ' |
|
64 | IfStatement | RuntimeError | 164 : 19 | . ... ' |
|
65 | BinaryExpression | RuntimeError | 164 : 31 | === |
!== |
66 | BinaryExpression | Killed | 164 : 37 | && |
|| |
67 | BinaryExpression | RuntimeError | 164 : 55 | === |
!== |
68 | StringLiteral | RuntimeError | 164 : 59 | ' ' |
"" |
69 | Block | RuntimeError | 164 : 69 | {
... } |
{} |
70 | ArrayLiteral | RuntimeError | 165 : 61 | [ ... ] |
[] |
71 | StringLiteral | Survived | 168 : 24 | ' ... .' |
"" |
72 | Block | RuntimeError | 192 : 50 | {
... };
} |
{} |
73 | Block | RuntimeError | 193 : 42 | {
... } |
{} |
74 | IfStatement | RuntimeError | 195 : 12 | . === |
|
75 | IfStatement | RuntimeError | 195 : 12 | . === |
|
76 | BinaryExpression | RuntimeError | 195 : 24 | === |
!== |
77 | Block | RuntimeError | 195 : 31 | {
... } |
{} |
78 | ArrayLiteral | RuntimeError | 196 : 51 | [ ... ] |
[] |
79 | IfStatement | RuntimeError | 197 : 19 | . ... ' |
|
80 | IfStatement | RuntimeError | 197 : 19 | . ... ' |
|
81 | BinaryExpression | RuntimeError | 197 : 31 | === |
!== |
82 | BinaryExpression | RuntimeError | 197 : 37 | && |
|| |
83 | BinaryExpression | RuntimeError | 197 : 55 | === |
!== |
84 | StringLiteral | RuntimeError | 197 : 59 | ' ' |
"" |
85 | Block | RuntimeError | 197 : 69 | {
... } |
{} |
86 | ArrayLiteral | RuntimeError | 198 : 53 | [ ... ] |
[] |
87 | StringLiteral | Survived | 201 : 24 | ' ... .' |
"" |
88 | Block | RuntimeError | 224 : 45 | {
...');
} |
{} |
89 | ArrayLiteral | Killed | 226 : 32 | [ ... ] |
[] |
90 | IfStatement | RuntimeError | 227 : 8 | . ... ' |
|
91 | IfStatement | RuntimeError | 227 : 8 | . ... ' |
|
92 | BinaryExpression | RuntimeError | 227 : 20 | < |
>= |
93 | BinaryExpression | Killed | 227 : 20 | < |
<= |
94 | BinaryExpression | RuntimeError | 227 : 24 | || |
&& |
95 | BinaryExpression | Survived | 227 : 42 | === |
!== |
96 | StringLiteral | RuntimeError | 227 : 46 | ' ' |
"" |
97 | Block | RuntimeError | 227 : 59 | {
... } |
{} |
98 | IfStatement | RuntimeError | 229 : 15 | . ... ' |
|
99 | IfStatement | Killed | 229 : 15 | . ... ' |
|
100 | BinaryExpression | RuntimeError | 229 : 27 | === |
!== |
101 | BinaryExpression | RuntimeError | 229 : 33 | && |
|| |
102 | BinaryExpression | Survived | 229 : 51 | === |
!== |
103 | StringLiteral | RuntimeError | 229 : 55 | ' ' |
"" |
104 | Block | Killed | 229 : 65 | {
... } |
{} |
105 | StringLiteral | RuntimeError | 233 : 20 | ' ... .' |
"" |
106 | Block | RuntimeError | 255 : 52 | {
...');
} |
{} |
107 | ArrayLiteral | RuntimeError | 257 : 32 | [ ... ] |
[] |
108 | IfStatement | RuntimeError | 258 : 8 | . ... ' |
|
109 | IfStatement | RuntimeError | 258 : 8 | . ... ' |
|
110 | BinaryExpression | RuntimeError | 258 : 20 | < |
<= |
111 | BinaryExpression | RuntimeError | 258 : 20 | < |
>= |
112 | BinaryExpression | Killed | 258 : 24 | || |
&& |
113 | BinaryExpression | RuntimeError | 258 : 42 | === |
!== |
114 | StringLiteral | RuntimeError | 258 : 46 | ' ' |
"" |
115 | Block | RuntimeError | 258 : 59 | {
... } |
{} |
116 | IfStatement | RuntimeError | 260 : 15 | . ... ' |
|
117 | IfStatement | Survived | 260 : 15 | . ... ' |
|
118 | BinaryExpression | RuntimeError | 260 : 27 | === |
!== |
119 | BinaryExpression | Killed | 260 : 33 | && |
|| |
120 | BinaryExpression | RuntimeError | 260 : 51 | === |
!== |
121 | StringLiteral | RuntimeError | 260 : 55 | ' ' |
"" |
122 | Block | RuntimeError | 260 : 65 | {
... } |
{} |
123 | StringLiteral | Survived | 264 : 20 | ' ... .' |
"" |
124 | Block | RuntimeError | 286 : 53 | {
...');
} |
{} |
125 | ArrayLiteral | Killed | 288 : 32 | [ ... ] |
[] |
126 | IfStatement | RuntimeError | 289 : 8 | . ... ' |
|
127 | IfStatement | RuntimeError | 289 : 8 | . ... ' |
|
128 | BinaryExpression | RuntimeError | 289 : 20 | < |
<= |
129 | BinaryExpression | Killed | 289 : 20 | < |
>= |
130 | BinaryExpression | Killed | 289 : 24 | || |
&& |
131 | BinaryExpression | RuntimeError | 289 : 42 | === |
!== |
132 | StringLiteral | RuntimeError | 289 : 46 | ' ' |
"" |
133 | Block | RuntimeError | 289 : 59 | {
... } |
{} |
134 | IfStatement | RuntimeError | 291 : 15 | . ... ' |
|
135 | IfStatement | RuntimeError | 291 : 15 | . ... ' |
|
136 | BinaryExpression | RuntimeError | 291 : 27 | === |
!== |
137 | BinaryExpression | Survived | 291 : 33 | && |
|| |
138 | BinaryExpression | RuntimeError | 291 : 51 | === |
!== |
139 | StringLiteral | RuntimeError | 291 : 55 | ' ' |
"" |
140 | Block | RuntimeError | 291 : 65 | {
... } |
{} |
141 | StringLiteral | Killed | 295 : 20 | ' ... .' |
"" |
142 | Block | Killed | 317 : 49 | {
...');
} |
{} |
143 | ArrayLiteral | RuntimeError | 319 : 32 | [ ... ] |
[] |
144 | IfStatement | RuntimeError | 320 : 8 | . ... ' |
|
145 | IfStatement | RuntimeError | 320 : 8 | . ... ' |
|
146 | BinaryExpression | RuntimeError | 320 : 20 | < |
>= |
147 | BinaryExpression | Killed | 320 : 20 | < |
<= |
148 | BinaryExpression | Survived | 320 : 24 | || |
&& |
149 | BinaryExpression | RuntimeError | 320 : 42 | === |
!== |
150 | StringLiteral | RuntimeError | 320 : 46 | ' ' |
"" |
151 | Block | RuntimeError | 320 : 59 | {
... } |
{} |
152 | IfStatement | RuntimeError | 322 : 15 | . ... ' |
|
153 | IfStatement | Killed | 322 : 15 | . ... ' |
|
154 | BinaryExpression | RuntimeError | 322 : 27 | === |
!== |
155 | BinaryExpression | Killed | 322 : 33 | && |
|| |
156 | BinaryExpression | RuntimeError | 322 : 51 | === |
!== |
157 | StringLiteral | RuntimeError | 322 : 55 | ' ' |
"" |
158 | Block | RuntimeError | 322 : 65 | {
... } |
{} |
159 | StringLiteral | Killed | 326 : 20 | ' ... .' |
"" |
160 | Block | RuntimeError | 345 : 53 | {
...');
} |
{} |
161 | ArrayLiteral | Killed | 347 : 32 | [ ... ] |
[] |
162 | IfStatement | RuntimeError | 348 : 8 | . ... ' |
|
163 | IfStatement | Killed | 348 : 8 | . ... ' |
|
164 | BinaryExpression | RuntimeError | 348 : 20 | < |
<= |
165 | BinaryExpression | RuntimeError | 348 : 20 | < |
>= |
166 | BinaryExpression | Killed | 348 : 24 | || |
&& |
167 | BinaryExpression | RuntimeError | 348 : 42 | === |
!== |
168 | StringLiteral | RuntimeError | 348 : 46 | ' ' |
"" |
169 | Block | RuntimeError | 348 : 59 | {
... } |
{} |
170 | IfStatement | RuntimeError | 350 : 15 | . ... ' |
|
171 | IfStatement | Survived | 350 : 15 | . ... ' |
|
172 | BinaryExpression | RuntimeError | 350 : 27 | === |
!== |
173 | BinaryExpression | RuntimeError | 350 : 33 | && |
|| |
174 | BinaryExpression | RuntimeError | 350 : 51 | === |
!== |
175 | StringLiteral | RuntimeError | 350 : 55 | ' ' |
"" |
176 | Block | RuntimeError | 350 : 65 | {
... } |
{} |
177 | StringLiteral | RuntimeError | 354 : 20 | ' ... .' |
"" |
178 | Block | RuntimeError | 373 : 51 | {
...');
} |
{} |
179 | ArrayLiteral | Killed | 375 : 32 | [ ... ] |
[] |
180 | IfStatement | RuntimeError | 376 : 8 | . ... ' |
|
181 | IfStatement | Killed | 376 : 8 | . ... ' |
|
182 | BinaryExpression | RuntimeError | 376 : 20 | < |
>= |
183 | BinaryExpression | Killed | 376 : 20 | < |
<= |
184 | BinaryExpression | RuntimeError | 376 : 24 | || |
&& |
185 | BinaryExpression | RuntimeError | 376 : 42 | === |
!== |
186 | StringLiteral | RuntimeError | 376 : 46 | ' ' |
"" |
187 | Block | RuntimeError | 376 : 59 | {
... } |
{} |
188 | IfStatement | RuntimeError | 378 : 15 | . ... ' |
|
189 | IfStatement | RuntimeError | 378 : 15 | . ... ' |
|
190 | BinaryExpression | RuntimeError | 378 : 27 | === |
!== |
191 | BinaryExpression | Survived | 378 : 33 | && |
|| |
192 | BinaryExpression | RuntimeError | 378 : 51 | === |
!== |
193 | StringLiteral | RuntimeError | 378 : 55 | ' ' |
"" |
194 | Block | RuntimeError | 378 : 65 | {
... } |
{} |
195 | StringLiteral | RuntimeError | 382 : 20 | ' ... .' |
"" |
196 | Block | Killed | 408 : 36 | {
... );
} |
{} |
197 | Block | RuntimeError | 435 : 36 | {
... );
} |
{} |
198 | Block | RuntimeError | 463 : 36 | {
... );
} |
{} |
199 | Block | RuntimeError | 491 : 36 | {
... );
} |
{} |
200 | Block | Survived | 518 : 36 | {
... );
} |
{} |
201 | Block | RuntimeError | 545 : 36 | {
... );
} |
{} |
202 | Block | Killed | 573 : 36 | {
... );
} |
{} |
203 | Block | RuntimeError | 582 : 42 | {
... };
} |
{} |
204 | Block | RuntimeError | 583 : 86 | {
... } |
{} |
205 | IfStatement | RuntimeError | 585 : 12 |
|
|
206 | IfStatement | Killed | 585 : 12 |
|
|
207 | Block | RuntimeError | 585 : 27 | { // ... } |
{} |
208 | Block | RuntimeError | 616 : 40 | {
... };
} |
{} |
209 | Block | RuntimeError | 617 : 42 | {
... } |
{} |
210 | ArrayLiteral | RuntimeError | 619 : 36 | [ ... ] |
[] |
211 | IfStatement | RuntimeError | 620 : 12 | . ... ' |
|
212 | IfStatement | Survived | 620 : 12 | . ... ' |
|
213 | BinaryExpression | RuntimeError | 620 : 24 | < |
<= |
214 | BinaryExpression | RuntimeError | 620 : 24 | < |
>= |
215 | BinaryExpression | Killed | 620 : 28 | || |
&& |
216 | BinaryExpression | RuntimeError | 620 : 46 | === |
!== |
217 | StringLiteral | RuntimeError | 620 : 50 | ' ' |
"" |
218 | Block | RuntimeError | 620 : 63 | {
... } |
{} |
219 | IfStatement | RuntimeError | 622 : 19 | . ... ' |
|
220 | IfStatement | Killed | 622 : 19 | . ... ' |
|
221 | BinaryExpression | RuntimeError | 622 : 31 | === |
!== |
222 | BinaryExpression | Survived | 622 : 37 | && |
|| |
223 | BinaryExpression | RuntimeError | 622 : 55 | === |
!== |
224 | StringLiteral | RuntimeError | 622 : 59 | ' ' |
"" |
225 | Block | RuntimeError | 622 : 69 | {
... } |
{} |
226 | StringLiteral | RuntimeError | 626 : 24 | ' ... .' |
"" |
227 | Block | RuntimeError | 652 : 40 | {
... };
} |
{} |
228 | Block | RuntimeError | 653 : 42 | {
... } |
{} |
229 | ArrayLiteral | RuntimeError | 655 : 36 | [ ... ] |
[] |
230 | IfStatement | RuntimeError | 656 : 12 | . ... ' |
|
231 | IfStatement | Survived | 656 : 12 | . ... ' |
|
232 | BinaryExpression | RuntimeError | 656 : 24 | < |
>= |
233 | BinaryExpression | RuntimeError | 656 : 24 | < |
<= |
234 | BinaryExpression | RuntimeError | 656 : 28 | || |
&& |
235 | BinaryExpression | RuntimeError | 656 : 46 | === |
!== |
236 | StringLiteral | RuntimeError | 656 : 50 | ' ' |
"" |
237 | Block | Killed | 656 : 63 | {
... } |
{} |
238 | IfStatement | RuntimeError | 658 : 19 | . ... ' |
|
239 | IfStatement | RuntimeError | 658 : 19 | . ... ' |
|
240 | BinaryExpression | RuntimeError | 658 : 31 | === |
!== |
241 | BinaryExpression | RuntimeError | 658 : 37 | && |
|| |
242 | BinaryExpression | RuntimeError | 658 : 55 | === |
!== |
243 | StringLiteral | RuntimeError | 658 : 59 | ' ' |
"" |
244 | Block | RuntimeError | 658 : 69 | {
... } |
{} |
245 | StringLiteral | Killed | 662 : 24 | ' ... .' |
"" |
246 | Block | RuntimeError | 688 : 41 | {
... };
} |
{} |
247 | Block | Survived | 689 : 42 | {
... } |
{} |
248 | ArrayLiteral | Killed | 691 : 36 | [ ... ] |
[] |
249 | IfStatement | RuntimeError | 692 : 12 | . ... ' |
|
250 | IfStatement | RuntimeError | 692 : 12 | . ... ' |
|
251 | BinaryExpression | Killed | 692 : 24 | < |
>= |
252 | BinaryExpression | Killed | 692 : 24 | < |
<= |
253 | BinaryExpression | RuntimeError | 692 : 28 | || |
&& |
254 | BinaryExpression | RuntimeError | 692 : 46 | === |
!== |
255 | StringLiteral | RuntimeError | 692 : 50 | ' ' |
"" |
256 | Block | Survived | 692 : 63 | {
... } |
{} |
257 | IfStatement | RuntimeError | 694 : 19 | . ... ' |
|
258 | IfStatement | Killed | 694 : 19 | . ... ' |
|
259 | BinaryExpression | Killed | 694 : 31 | === |
!== |
260 | BinaryExpression | RuntimeError | 694 : 37 | && |
|| |
261 | BinaryExpression | RuntimeError | 694 : 55 | === |
!== |
262 | StringLiteral | RuntimeError | 694 : 59 | ' ' |
"" |
263 | Block | RuntimeError | 694 : 69 | {
... } |
{} |
264 | StringLiteral | Killed | 698 : 24 | ' ... .' |
"" |
265 | Block | RuntimeError | 726 : 41 | {
... };
} |
{} |
266 | Block | RuntimeError | 727 : 42 | {
... } |
{} |
267 | ArrayLiteral | RuntimeError | 729 : 36 | [ ... ] |
[] |
268 | IfStatement | RuntimeError | 730 : 12 | . ... ' |
|
269 | IfStatement | Killed | 730 : 12 | . ... ' |
|
270 | BinaryExpression | RuntimeError | 730 : 24 | < |
<= |
271 | BinaryExpression | RuntimeError | 730 : 24 | < |
>= |
272 | BinaryExpression | Survived | 730 : 28 | || |
&& |
273 | BinaryExpression | RuntimeError | 730 : 46 | === |
!== |
274 | StringLiteral | RuntimeError | 730 : 50 | ' ' |
"" |
275 | Block | Killed | 730 : 63 | {
... } |
{} |
276 | IfStatement | RuntimeError | 732 : 19 | . ... ' |
|
277 | IfStatement | Killed | 732 : 19 | . ... ' |
|
278 | BinaryExpression | RuntimeError | 732 : 31 | === |
!== |
279 | BinaryExpression | RuntimeError | 732 : 37 | && |
|| |
280 | BinaryExpression | RuntimeError | 732 : 55 | === |
!== |
281 | StringLiteral | RuntimeError | 732 : 59 | ' ' |
"" |
282 | Block | RuntimeError | 732 : 69 | {
... } |
{} |
283 | StringLiteral | Survived | 736 : 24 | ' ... .' |
"" |
284 | Block | RuntimeError | 759 : 42 | {
... };
} |
{} |
285 | Block | RuntimeError | 760 : 42 | {
... } |
{} |
286 | ArrayLiteral | Killed | 762 : 36 | [ ... ] |
[] |
287 | IfStatement | RuntimeError | 763 : 12 | . ... ' |
|
288 | IfStatement | RuntimeError | 763 : 12 | . ... ' |
|
289 | BinaryExpression | RuntimeError | 763 : 24 | < |
<= |
290 | BinaryExpression | Killed | 763 : 24 | < |
>= |
291 | BinaryExpression | Killed | 763 : 28 | || |
&& |
292 | BinaryExpression | RuntimeError | 763 : 46 | === |
!== |
293 | StringLiteral | RuntimeError | 763 : 50 | ' ' |
"" |
294 | Block | RuntimeError | 763 : 63 | {
... } |
{} |
295 | IfStatement | RuntimeError | 765 : 19 | . ... ' |
|
296 | IfStatement | Survived | 765 : 19 | . ... ' |
|
297 | BinaryExpression | RuntimeError | 765 : 31 | === |
!== |
298 | BinaryExpression | RuntimeError | 765 : 37 | && |
|| |
299 | BinaryExpression | RuntimeError | 765 : 55 | === |
!== |
300 | StringLiteral | RuntimeError | 765 : 59 | ' ' |
"" |
301 | Block | RuntimeError | 765 : 69 | {
... } |
{} |
302 | StringLiteral | Survived | 769 : 24 | ' ... .' |
"" |
303 | Block | RuntimeError | 792 : 42 | {
... };
} |
{} |
304 | Block | RuntimeError | 793 : 42 | {
... } |
{} |
305 | ArrayLiteral | Killed | 795 : 36 | [ ... ] |
[] |
306 | IfStatement | RuntimeError | 796 : 12 | . ... ' |
|
307 | IfStatement | Killed | 796 : 12 | . ... ' |
|
308 | BinaryExpression | RuntimeError | 796 : 24 | < |
<= |
309 | BinaryExpression | RuntimeError | 796 : 24 | < |
>= |
310 | BinaryExpression | RuntimeError | 796 : 28 | || |
&& |
311 | BinaryExpression | Killed | 796 : 46 | === |
!== |
312 | StringLiteral | RuntimeError | 796 : 50 | ' ' |
"" |
313 | Block | RuntimeError | 796 : 63 | {
... } |
{} |
314 | IfStatement | RuntimeError | 798 : 19 | . ... ' |
|
315 | IfStatement | RuntimeError | 798 : 19 | . ... ' |
|
316 | BinaryExpression | RuntimeError | 798 : 31 | === |
!== |
317 | BinaryExpression | Survived | 798 : 37 | && |
|| |
318 | BinaryExpression | RuntimeError | 798 : 55 | === |
!== |
319 | StringLiteral | RuntimeError | 798 : 59 | ' ' |
"" |
320 | Block | RuntimeError | 798 : 69 | {
... } |
{} |
321 | StringLiteral | RuntimeError | 802 : 24 | ' ... .' |
"" |
322 | Block | RuntimeError | 826 : 40 | {
... };
} |
{} |
323 | Block | RuntimeError | 827 : 42 | {
... } |
{} |
324 | ArrayLiteral | Killed | 829 : 36 | [ ... ] |
[] |
325 | IfStatement | RuntimeError | 830 : 12 | . ... ' |
|
326 | IfStatement | Killed | 830 : 12 | . ... ' |
|
327 | BinaryExpression | Killed | 830 : 24 | < |
<= |
328 | BinaryExpression | Killed | 830 : 24 | < |
>= |
329 | BinaryExpression | RuntimeError | 830 : 28 | || |
&& |
330 | BinaryExpression | RuntimeError | 830 : 46 | === |
!== |
331 | StringLiteral | RuntimeError | 830 : 50 | ' ' |
"" |
332 | Block | RuntimeError | 830 : 63 | {
... } |
{} |
333 | IfStatement | RuntimeError | 832 : 19 | . ... ' |
|
334 | IfStatement | Survived | 832 : 19 | . ... ' |
|
335 | BinaryExpression | RuntimeError | 832 : 31 | === |
!== |
336 | BinaryExpression | RuntimeError | 832 : 37 | && |
|| |
337 | BinaryExpression | RuntimeError | 832 : 55 | === |
!== |
338 | StringLiteral | RuntimeError | 832 : 59 | ' ' |
"" |
339 | Block | RuntimeError | 832 : 69 | {
... } |
{} |
340 | StringLiteral | Killed | 836 : 24 | ' ... .' |
"" |
341 | Block | RuntimeError | 861 : 36 | {
... };
} |
{} |
342 | Block | Killed | 862 : 42 | {
... } |
{} |
343 | ArrayLiteral | RuntimeError | 864 : 36 | [ ... ] |
[] |
344 | IfStatement | RuntimeError | 865 : 12 | . ... ' |
|
345 | IfStatement | Killed | 865 : 12 | . ... ' |
|
346 | BinaryExpression | RuntimeError | 865 : 24 | < |
<= |
347 | BinaryExpression | Killed | 865 : 24 | < |
>= |
348 | BinaryExpression | Survived | 865 : 28 | || |
&& |
349 | BinaryExpression | Killed | 865 : 46 | === |
!== |
350 | StringLiteral | RuntimeError | 865 : 50 | ' ' |
"" |
351 | Block | RuntimeError | 865 : 63 | {
... } |
{} |
352 | IfStatement | RuntimeError | 867 : 19 | . ... ' |
|
353 | IfStatement | Killed | 867 : 19 | . ... ' |
|
354 | BinaryExpression | RuntimeError | 867 : 31 | === |
!== |
355 | BinaryExpression | Survived | 867 : 37 | && |
|| |
356 | BinaryExpression | RuntimeError | 867 : 55 | === |
!== |
357 | StringLiteral | RuntimeError | 867 : 59 | ' ' |
"" |
358 | Block | RuntimeError | 867 : 69 | {
... } |
{} |
359 | StringLiteral | Killed | 871 : 24 | ' ... .' |
"" |
360 | Block | Killed | 894 : 43 | {
... ;
} |
{} |
361 | BooleanSubstitution | RuntimeError | 896 : 27 |
|
|
362 | Block | RuntimeError | 902 : 81 | {
... );
} |
{} |
363 | Block | Killed | 911 : 62 | {
... }
} |
{} |
364 | IfStatement | RuntimeError | 913 : 8 |
|
|
365 | IfStatement | Survived | 913 : 8 |
|
|
366 | Block | RuntimeError | 913 : 23 | { // ... } |
{} |
367 | Block | Killed | 921 : 71 | {
... );
} |
{} |
368 | Block | RuntimeError | 930 : 60 | {
... }
} |
{} |
369 | IfStatement | RuntimeError | 932 : 8 |
|
|
370 | IfStatement | Killed | 932 : 8 |
|
|
371 | Block | RuntimeError | 932 : 23 | { // ... } |
{} |
372 | Block | Killed | 940 : 59 | {
... }
} |
{} |
373 | IfStatement | RuntimeError | 942 : 8 |
|
|
374 | IfStatement | RuntimeError | 942 : 8 |
|
|
375 | Block | Killed | 942 : 19 | {
... } |
{} |
376 | Block | Killed | 951 : 50 | {
... }
} |
{} |
377 | IfStatement | RuntimeError | 953 : 8 |
|
|
378 | IfStatement | RuntimeError | 953 : 8 |
|
|
379 | Block | Killed | 953 : 23 | { // ... } |
{} |
380 | Block | RuntimeError | 961 : 71 | {
... }
} |
{} |
381 | IfStatement | RuntimeError | 963 : 8 |
|
|
382 | IfStatement | Killed | 963 : 8 |
|
|
383 | Block | Killed | 963 : 19 | {
... } |
{} |
384 | Block | RuntimeError | 972 : 58 | {
... }
} |
{} |
385 | IfStatement | RuntimeError | 974 : 8 |
|
|
386 | IfStatement | Survived | 974 : 8 |
|
|
387 | Block | RuntimeError | 974 : 23 | { // ... } |
{} |
388 | Block | Killed | 982 : 98 | {
... }
} |
{} |
389 | IfStatement | RuntimeError | 984 : 8 |
|
|
390 | IfStatement | Killed | 984 : 8 |
|
|
391 | Block | RuntimeError | 984 : 19 | {
... } |
{} |
392 | PrefixUnaryExpression | RuntimeError | 985 : 12 | ! . |
. |
393 | IfStatement | Killed | 985 : 12 | ! . |
|
394 | IfStatement | RuntimeError | 985 : 12 | ! . |
|
395 | Block | RuntimeError | 985 : 35 | {
... } |
{} |
396 | ArrayLiteral | RuntimeError | 986 : 35 | [] |
[' ... '] |
397 | Block | RuntimeError | 996 : 81 | {
... }
} |
{} |
398 | IfStatement | Killed | 998 : 8 |
|
|
399 | IfStatement | Killed | 998 : 8 |
|
|
400 | Block | RuntimeError | 998 : 23 | {
... } |
{} |
401 | PrefixUnaryExpression | RuntimeError | 999 : 12 | ! . |
. |
402 | IfStatement | RuntimeError | 999 : 12 | ! . |
|
403 | IfStatement | Killed | 999 : 12 | ! . |
|
404 | Block | RuntimeError | 999 : 39 | {
... } |
{} |
405 | ArrayLiteral | RuntimeError | 1000 : 39 | [] |
[' ... '] |
406 | Block | RuntimeError | 1010 : 49 | {
... }
} |
{} |
407 | IfStatement | RuntimeError | 1012 : 8 |
|
|
408 | IfStatement | Survived | 1012 : 8 |
|
|
409 | Block | RuntimeError | 1012 : 23 | { // ... } |
{} |
410 | StringLiteral | RuntimeError | 1013 : 50 | ' ... ' |
"" |
411 | WhileStatement | RuntimeError | 1015 : 15 | && ... . |
|
412 | BinaryExpression | TimedOut | 1015 : 26 | && |
|| |
413 | BinaryExpression | RuntimeError | 1015 : 61 | < |
>= |
414 | BinaryExpression | RuntimeError | 1015 : 61 | < |
<= |
415 | Block | RuntimeError | 1015 : 82 | {
... } |
{} |
416 | Block | RuntimeError | 1026 : 115 | {
... );
} |
{} |
417 | StringLiteral | Killed | 1028 : 45 | ' : ' |
"" |
418 | Block | RuntimeError | 1036 : 28 | {
... }
} |
{} |
419 | IfStatement | RuntimeError | 1038 : 8 |
|
|
420 | IfStatement | Killed | 1038 : 8 |
|
|
421 | Block | RuntimeError | 1038 : 23 | { // ... } |
{} |
422 | IfStatement | RuntimeError | 1039 : 12 | . ... !== |
|
423 | IfStatement | Survived | 1039 : 12 | . ... !== |
|
424 | BinaryExpression | RuntimeError | 1039 : 37 | && |
|| |
425 | BinaryExpression | RuntimeError | 1039 : 65 | !== |
=== |
426 | Block | RuntimeError | 1039 : 81 | {
... } |
{} |
427 | StringLiteral | RuntimeError | 1040 : 28 | ' ... @' |
"" |
428 | BinaryExpression | RuntimeError | 1040 : 65 | + |
- |
429 | BinaryExpression | RuntimeError | 1041 : 53 | + |
- |
430 | StringLiteral | RuntimeError | 1042 : 16 | '. ... .' |
"" |
431 | Block | Killed | 1052 : 103 | {
...});
} |
{} |
432 | StringLiteral | RuntimeError | 1054 : 46 | ' ... ' |
"" |
433 | WhileStatement | RuntimeError | 1055 : 11 | && ... . |
|
434 | BinaryExpression | TimedOut | 1055 : 22 | && |
|| |
435 | BinaryExpression | RuntimeError | 1055 : 43 | > |
<= |
436 | BinaryExpression | RuntimeError | 1055 : 43 | > |
>= |
437 | Block | RuntimeError | 1055 : 78 | {
... } |
{} |
438 | Block | Killed | 1060 : 46 | {
... } |
{} |
439 | IfStatement | RuntimeError | 1061 : 12 | . ... . |
|
440 | IfStatement | RuntimeError | 1061 : 12 | . ... . |
|
441 | BinaryExpression | RuntimeError | 1061 : 28 | === |
!== |
442 | Block | RuntimeError | 1061 : 59 | {
... } |
{} |
443 | BooleanSubstitution | Killed | 1062 : 45 |
|
|
444 | IfStatement | RuntimeError | 1063 : 19 | . ... . |
|
445 | IfStatement | RuntimeError | 1063 : 19 | . ... . |
|
446 | BinaryExpression | RuntimeError | 1063 : 35 | === |
!== |
447 | Block | RuntimeError | 1063 : 64 | {
... } |
{} |
448 | BooleanSubstitution | RuntimeError | 1064 : 72 |
|
|
449 | IfStatement | RuntimeError | 1065 : 19 | . ... . |
|
450 | IfStatement | Killed | 1065 : 19 | . ... . |
|
451 | BinaryExpression | RuntimeError | 1065 : 35 | === |
!== |
452 | Block | Survived | 1065 : 65 | {
... } |
{} |
453 | BooleanSubstitution | RuntimeError | 1066 : 72 |
|
|
454 | IfStatement | RuntimeError | 1067 : 19 | . ... . |
|
455 | IfStatement | RuntimeError | 1067 : 19 | . ... . |
|
456 | BinaryExpression | RuntimeError | 1067 : 35 | === |
!== |
457 | Block | RuntimeError | 1067 : 65 | {
... } |
{} |
458 | BooleanSubstitution | Killed | 1068 : 50 |
|
|
459 | IfStatement | RuntimeError | 1069 : 19 | . ... . |
|
460 | IfStatement | RuntimeError | 1069 : 19 | . ... . |
|
461 | BinaryExpression | RuntimeError | 1069 : 35 | === |
!== |
462 | Block | RuntimeError | 1069 : 64 | {
... } |
{} |
463 | IfStatement | RuntimeError | 1070 : 16 | . |
|
464 | IfStatement | RuntimeError | 1070 : 16 | . |
|
465 | Block | RuntimeError | 1070 : 45 | {
... } |
{} |
466 | StringLiteral | Survived | 1071 : 28 | ' ... .' |
"" |
467 | BooleanSubstitution | RuntimeError | 1073 : 43 |
|
|
468 | IfStatement | RuntimeError | 1074 : 19 | . ... . |
|
469 | IfStatement | RuntimeError | 1074 : 19 | . ... . |
|
470 | BinaryExpression | RuntimeError | 1074 : 35 | === |
!== |
471 | Block | RuntimeError | 1074 : 64 | {
... } |
{} |
472 | IfStatement | RuntimeError | 1075 : 16 | . |
|
473 | IfStatement | Survived | 1075 : 16 | . |
|
474 | Block | RuntimeError | 1075 : 46 | {
... } |
{} |
475 | StringLiteral | RuntimeError | 1076 : 28 | ' ... .' |
"" |
476 | IfStatement | RuntimeError | 1078 : 16 | . |
|
477 | IfStatement | RuntimeError | 1078 : 16 | . |
|
478 | Block | RuntimeError | 1078 : 45 | {
... } |
{} |
479 | StringLiteral | RuntimeError | 1079 : 28 | ' ... .' |
"" |
480 | BooleanSubstitution | Killed | 1081 : 42 |
|
|