It is perfectly legitimate to create and/or use a method named `define`
in JS outside of RequireJS.
Unfortunately our requirejs.php wrapper is dumb and does not understand
this.
In the long term we need to stop doing this at all. We really should be
able to already, but every time I try to something prevents it.
In the interim, this change adds a secondary check to see if there is an
existing define which _does_ have the right name in it already.
We now include more polyfills than we have ever done, and some of these
cause false-positives on our code to address modules which do not have a
name.
We started adding module names to modules in Moodle 3.8 at _build_ time
and kept support for modules which were not transpiled using Babel
before that point.
We no longer need to support this as all pre-3.8 Moodle versions are
long out of support. The most recent to go out of support was Moodle
3.5, which went completely out of support in May 2021.
We should not support code written and minified without a transpilation
phase from this time any longer.
This option was used to return the source files, but we do not support
this any more because we use source maps instead and require babel
transformation to support ES2015.
It does not make sense to support this code path any longer.