ChakraCore icon indicating copy to clipboard operation
ChakraCore copied to clipboard

chakarcore have not implement some es6 syntax

Open halfsprit opened this issue 3 years ago • 5 comments

Chakracore can't support some important nodejs module, like 'commonmark' and 'graphql'

var reLinkLabel = /^[(?:[^\[]]|\.){0,1000}]/s; JavaScript failed to compile. SyntaxError: Syntax error in regular expression function KnownArgumentNamesRule(context) { return { // eslint-disable-next-line new-cap ...KnownArgumentNamesOnDirectivesRule(context), <----- syntax error

Argument(argNode) {
  const argDef = context.getArgument();
  const fieldDef = context.getFieldDef();
  const parentType = context.getParentType();

  if (!argDef && fieldDef && parentType) {
    const argName = argNode.name.value;
    const knownArgsNames = fieldDef.args.map((arg) => arg.name);
    const suggestions = (0, _suggestionList.suggestionList)(
      argName,
      knownArgsNames,
    );
    context.reportError(
      new _GraphQLError.GraphQLError(
        `Unknown argument "${argName}" on field "${parentType.name}.${fieldDef.name}".` +
          (0, _didYouMean.didYouMean)(suggestions),
        argNode,
      ),
    );
  }
},

}; }

it seems that chakracore can't support some es6 syntax, and I can't find some test example in chakracore\test,there's only example about spread syntax for array

halfsprit avatar Feb 03 '22 12:02 halfsprit

The s flag is the dotAll flag, and isn’t in ES6/ES2015 - it’s in ES2018.

ljharb avatar Feb 03 '22 16:02 ljharb

The s flag is the dotAll flag, and isn’t in ES6/ES2015 - it’s in ES2018.

Can chakracore support it? How can I do? and the spread syntax let objClone = { ...obj } ? also new in ES2018

I'm using the chakracore.dll v1.11.24.0

halfsprit avatar Feb 03 '22 22:02 halfsprit

{ ...obj } is enabled by default in master. It's not present in any released version.

pleath avatar Feb 04 '22 00:02 pleath

{ ...obj } is enabled by default in master. It's not present in any released version.

thank you, I build the latest version, get a new chakracore.dll v1.13, problem resolved.

halfsprit avatar Feb 04 '22 02:02 halfsprit

The s flag is the dotAll flag, and isn’t in ES6/ES2015 - it’s in ES2018.

The s flag is also enabled by default in master.

As a side note, see https://github.com/chakra-core/org/blob/master/tc39%20Proposals.md for status on implementing recent Javascript features.

Sorry that we're running a bit behind, chakracore is now volunteer maintained and our available time is rather limited.

rhuanjl avatar Feb 04 '22 16:02 rhuanjl