dolphindb 3.0.227 → 3.0.229

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/i18n/dict.json CHANGED
@@ -112,5 +112,8 @@
112
112
  },
113
113
  "DDB.define 方法传入的 definition 不符合函数定义格式": {
114
114
  "en": "The definition passed in by the DDB.define method does not conform to the function definition format"
115
+ },
116
+ "DDB.define 方法传入的 definition 不符合函数定义格式 def xxx ()": {
117
+ "en": "The definition passed in by the DDB.define method does not conform to the function definition format def xxx ()"
115
118
  }
116
119
  }
package/index.js CHANGED
@@ -3152,9 +3152,9 @@ export class DDB {
3152
3152
  '}\n'),
3153
3153
  ['hello']) */
3154
3154
  async define(definition) {
3155
- const matches = /\bdef (\w+)\s?\(/.exec(definition);
3155
+ const matches = /\bdef (\w+) \(/.exec(definition);
3156
3156
  if (!matches)
3157
- throw new Error(t('DDB.define 方法传入的 definition 不符合函数定义格式'));
3157
+ throw new Error(t('DDB.define 方法传入的 definition 不符合函数定义格式 def xxx ()'));
3158
3158
  const func_name = matches[1];
3159
3159
  // 已定义成功
3160
3160
  if (this.definitions.has(func_name))