Based on the link provided in the comments, the % symbol is apparently used in some JavaScript V8 engine to indicate the C ++ runtime method that will be executed when parsing the JavaScript source code.
For example, a string in string.js :
return %StringBuilderConcat(parts, len + 1, "");
When it encounters a parser, the StringBuilderConcat method will be executed. You can find a list of the execution methods available for V8 JavaScript files in runtime.h (note I have no experience with C ++, so for all I know, this has nothing to do with the StringBuilderConcat method specified in string. js, but I think this is the same):
#define RUNTIME_FUNCTION_LIST_ALWAYS_1(F) \ \ F(GetProperty, 2, 1) \ F(KeyedGetProperty, 2, 1) \ F(StringBuilderConcat, 3, 1) \
As already mentioned, return %foo throw a SyntaxError in JavaScript.
James allardice
source share