diff --git a/index.html b/index.html
index 684e14a..ea4d5d3 100644
--- a/index.html
+++ b/index.html
@@ -3511,7 +3511,7 @@
1.5.4.2 MessageFormat String Functions
When a MessageFormat string function is called with arguments funcCtx (an Object), options (an Object), and input (an ECMAScript language value), the following steps are taken:
- - Let str be ? ToString(input).
- Let selectKeyClosure be a new Abstract Closure with parameters (keys) that captures str and performs the following steps when called:
- Let keyList be ? CreateListFromArrayLike(keys, « String »).
- If keyList contains str, return str.
- Else, return null.
- Let selectKey be CreateBuiltinFunction(selectKeyClosure, 1, "selectKey", « »).
- Let toPartsClosure be a new Abstract Closure with no parameters that captures funcCtx and str and performs the following steps when called:
- Let source be ! Get(funcCtx, "source").
- Let locale be ! Get(funcCtx, "locale").
- Let locale0 be ! Get(locale, "0").
- Let result be OrdinaryObjectCreate(%Object.prototype%).
- Perform ! CreateDataPropertyOrThrow(result, "type", "string").
- Perform ! CreateDataPropertyOrThrow(result, "source", source).
- Perform ! CreateDataPropertyOrThrow(result, "locale", locale0).
- Perform ! CreateDataPropertyOrThrow(result, "value", str).
- Return CreateArrayFromList(« result »).
- Let toParts be CreateBuiltinFunction(toPartsClosure, 0, "toParts", « »).
- Let toStringClosure be a new Abstract Closure with no parameters that captures str and performs the following steps when called:
- Return str.
- Let toString be CreateBuiltinFunction(toStringClosure, 0, "toString", « »).
- Let valueOf be CreateBuiltinFunction(toStringClosure, 0, "valueOf", « »).
- Let mv be OrdinaryObjectCreate(%Object.prototype%).
- Perform ! CreateDataPropertyOrThrow(mv, "type", "number").
- Perform ! CreateDataPropertyOrThrow(mv, "source", source).
- Perform ! CreateDataPropertyOrThrow(mv, "locale", numberFormat.[[Locale]]).
- Perform ! CreateDataPropertyOrThrow(mv, "options", opts).
- Perform ! CreateDataPropertyOrThrow(mv, "selectKey", selectKey).
- Perform ! CreateDataPropertyOrThrow(mv, "toParts", toParts).
- Perform ! CreateDataPropertyOrThrow(mv, "toString", toString).
- Perform ! CreateDataPropertyOrThrow(mv, "valueOf", valueOf).
- Return mv.
+ - Let str be ? ToString(input).
- Let source be ! Get(funcCtx, "source").
- Let locale be ! Get(funcCtx, "locale").
- Let locale0 be ! Get(locale, "0").
- Let selectKeyClosure be a new Abstract Closure with parameters (keys) that captures str and performs the following steps when called:
- Let keyList be ? CreateListFromArrayLike(keys, « String »).
- If keyList contains str, return str.
- Else, return null.
- Let selectKey be CreateBuiltinFunction(selectKeyClosure, 1, "selectKey", « »).
- Let toPartsClosure be a new Abstract Closure with no parameters that captures funcCtx and str and performs the following steps when called:
- Let result be OrdinaryObjectCreate(%Object.prototype%).
- Perform ! CreateDataPropertyOrThrow(result, "type", "string").
- Perform ! CreateDataPropertyOrThrow(result, "source", source).
- Perform ! CreateDataPropertyOrThrow(result, "locale", locale0).
- Perform ! CreateDataPropertyOrThrow(result, "value", str).
- Return CreateArrayFromList(« result »).
- Let toParts be CreateBuiltinFunction(toPartsClosure, 0, "toParts", « »).
- Let toStringClosure be a new Abstract Closure with no parameters that captures str and performs the following steps when called:
- Return str.
- Let toString be CreateBuiltinFunction(toStringClosure, 0, "toString", « »).
- Let valueOf be CreateBuiltinFunction(toStringClosure, 0, "valueOf", « »).
- Let mv be OrdinaryObjectCreate(%Object.prototype%).
- Perform ! CreateDataPropertyOrThrow(mv, "type", "string").
- Perform ! CreateDataPropertyOrThrow(mv, "source", source).
- Perform ! CreateDataPropertyOrThrow(mv, "locale", locale0).
- Perform ! CreateDataPropertyOrThrow(mv, "selectKey", selectKey).
- Perform ! CreateDataPropertyOrThrow(mv, "toParts", toParts).
- Perform ! CreateDataPropertyOrThrow(mv, "toString", toString).
- Perform ! CreateDataPropertyOrThrow(mv, "valueOf", valueOf).
- Return mv.
The "length" property of a MessageFormat string function is 3.
diff --git a/spec.emu b/spec.emu
index 2b4eb41..cec8821 100644
--- a/spec.emu
+++ b/spec.emu
@@ -518,15 +518,15 @@ contributors: Eemeli Aro
1. Let _str_ be ? ToString(_input_).
+ 1. Let _source_ be ! Get(_funcCtx_, *"source"*).
+ 1. Let _locale_ be ! Get(_funcCtx_, *"locale"*).
+ 1. Let _locale0_ be ! Get(_locale_, *"0"*).
1. Let _selectKeyClosure_ be a new Abstract Closure with parameters (_keys_) that captures _str_ and performs the following steps when called:
1. Let _keyList_ be ? CreateListFromArrayLike(_keys_, « String »).
1. If _keyList_ contains _str_, return _str_.
1. Else, return *null*.
1. Let _selectKey_ be CreateBuiltinFunction(_selectKeyClosure_, *1*, *"selectKey"*, « »).
1. Let _toPartsClosure_ be a new Abstract Closure with no parameters that captures _funcCtx_ and _str_ and performs the following steps when called:
- 1. Let _source_ be ! Get(_funcCtx_, *"source"*).
- 1. Let _locale_ be ! Get(_funcCtx_, *"locale"*).
- 1. Let _locale0_ be ! Get(_locale_, *"0"*).
1. Let _result_ be OrdinaryObjectCreate(%Object.prototype%).
1. Perform ! CreateDataPropertyOrThrow(_result_, *"type"*, *"string"*).
1. Perform ! CreateDataPropertyOrThrow(_result_, *"source"*, _source_).
@@ -539,10 +539,9 @@ contributors: Eemeli Aro
1. Let _toString_ be CreateBuiltinFunction(_toStringClosure_, *0*, *"toString"*, « »).
1. Let _valueOf_ be CreateBuiltinFunction(_toStringClosure_, *0*, *"valueOf"*, « »).
1. Let _mv_ be OrdinaryObjectCreate(%Object.prototype%).
- 1. Perform ! CreateDataPropertyOrThrow(_mv_, *"type"*, *"number"*).
+ 1. Perform ! CreateDataPropertyOrThrow(_mv_, *"type"*, *"string"*).
1. Perform ! CreateDataPropertyOrThrow(_mv_, *"source"*, _source_).
- 1. Perform ! CreateDataPropertyOrThrow(_mv_, *"locale"*, _numberFormat_.[[Locale]]).
- 1. Perform ! CreateDataPropertyOrThrow(_mv_, *"options"*, _opts_).
+ 1. Perform ! CreateDataPropertyOrThrow(_mv_, *"locale"*, _locale0_).
1. Perform ! CreateDataPropertyOrThrow(_mv_, *"selectKey"*, _selectKey_).
1. Perform ! CreateDataPropertyOrThrow(_mv_, *"toParts"*, _toParts_).
1. Perform ! CreateDataPropertyOrThrow(_mv_, *"toString"*, _toString_).