mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 03:36:18 +08:00
Drop support for iOS < 15.7 (#19847)
https://meta.discourse.org/t/224747
This commit is contained in:
@ -37,6 +37,45 @@ RSpec.describe DiscourseJsProcessor do
|
||||
end
|
||||
end
|
||||
|
||||
it "passes through modern JS syntaxes which are supported in our target browsers" do
|
||||
script = <<~JS.chomp
|
||||
optional?.chaining;
|
||||
const template = func`test`;
|
||||
class MyClass {
|
||||
classProperty = 1;
|
||||
#privateProperty = 1;
|
||||
#privateMethod() {
|
||||
console.log("hello world");
|
||||
}
|
||||
}
|
||||
let numericSeparator = 100_000_000;
|
||||
logicalAssignment ||= 2;
|
||||
nullishCoalescing ?? 'works';
|
||||
try {
|
||||
"optional catch binding";
|
||||
} catch {
|
||||
"works";
|
||||
}
|
||||
async function* asyncGeneratorFunction() {
|
||||
yield await Promise.resolve('a');
|
||||
}
|
||||
let a = {
|
||||
x,
|
||||
y,
|
||||
...spreadRest
|
||||
};
|
||||
JS
|
||||
|
||||
result = DiscourseJsProcessor.transpile(script, "blah", "blah/mymodule")
|
||||
expect(result).to eq <<~JS.strip
|
||||
define("blah/mymodule", [], function () {
|
||||
"use strict";
|
||||
|
||||
#{script.indent(2)}
|
||||
});
|
||||
JS
|
||||
end
|
||||
|
||||
it "correctly transpiles widget hbs" do
|
||||
result = DiscourseJsProcessor.transpile(<<~JS, "blah", "blah/mymodule")
|
||||
import hbs from "discourse/widgets/hbs-compiler";
|
||||
|
Reference in New Issue
Block a user