0

So, i am reading the Chromium's V8 source on github and i see a lot ot function calls which look like this: %CheckIsBootstrapping();. I've done a solid search on what does the modulo (%) operator do before the function call, but with no success so far. Can anyone explain what it does?

Atanas Atanasov
  • 506
  • 7
  • 11
  • 3
    V8 source is C++, isn't it? – nnnnnn Jun 27 '16 at 08:09
  • 3
    The V8 source code is probably not written in Javascript...!? – deceze Jun 27 '16 at 08:09
  • @nnnnnn https://chromium.googlesource.com/v8/v8/+/95f6b726c02823939340badf20ef0acdc6a63a12/src/harmony-array-includes.js parts of it are JS, apparently – Siguza Jun 27 '16 at 08:10
  • 3
    What I can surely say is that that's not standard Javascript and is most likely a custom pre-processor directive. – deceze Jun 27 '16 at 08:19
  • 2
    …and it can use this syntax because native JS code is executed with `--allow-natives-syntax` active – Bergi Jun 27 '16 at 08:51
  • It should also be noted that the `%` operator is not a modulo operator, it is the [remainder operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators#Remainder). There is a [proposal](http://wiki.ecmascript.org/doku.php?id=strawman:modulo_operator) to add a true modulo operator to a future version of JS. – Useless Code Jun 27 '16 at 10:32

0 Answers0